Skip to content

Commit

Permalink
docs: add docs about how to use CommandRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
tlux committed Jun 19, 2020
1 parent 5922f5a commit cbd1ce8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/command_runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@ defmodule CommandRunner do
{CommandRunner, name: MyApp.CommandRunner}
]
Supervisor.start_link(
children,
strategy: :one_for_one,
name: MyApp.Supervisor
)
end
end
Alternatively, you can define your own command runner.
defmodule MyApp.CommandRunner do
use CommandRunner
end
You can also mount that in your supervision tree.
defmodule MyApp.Application do
use Application
def start(_type, _args) do
children = [
MyApp.CommandRunner
]
Supervisor.start_link(
children,
strategy: :one_for_one,
Expand Down

0 comments on commit cbd1ce8

Please sign in to comment.