Application and basic MQTT subscriber
This commit is contained in:
@@ -3,16 +3,18 @@ defmodule NeonVertigoService do
|
||||
Documentation for `NeonVertigoService`.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Hello world.
|
||||
use Application
|
||||
|
||||
## Examples
|
||||
@impl true
|
||||
def start(_start_type, _start_args) do
|
||||
children = [
|
||||
# %{id: :emqtt, start: {:emqtt, :start_link, [[{:owner, self()}, {:username, "artemis"}, {:password, "artemis"}]]}},
|
||||
{NeonVertigoService.Mqtt, [{}]}
|
||||
]
|
||||
|
||||
iex> NeonVertigoService.hello()
|
||||
:world
|
||||
{:ok, _spid} = Supervisor.start_link(children, strategy: :one_for_one)
|
||||
# {:ok, mqtt_pid} = Supervisor.start_child(spid, %{id: :emqtt, start: {:emqtt, :start_link, [[{:owner, self()}, {:username, "artemis"}, {:password, "artemis"}]]}})
|
||||
# {:ok, _} = Supervisor.start_child(spid, {NeonVertigoService.Mqtt, [{mqtt_pid}]})
|
||||
|
||||
"""
|
||||
def hello do
|
||||
:world
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user