Created
October 31, 2020 23:31
-
-
Save krainboltgreene/b4523933ed4c5346d4776cefc42796d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ElixirContainerAgentExperiment.Application do | |
use Application | |
def start(_type, _args) do | |
children = [ | |
{ | |
Task.Supervisor, | |
name: ElixirContainerAgentExperiment.ExampleSupervisor | |
} | |
] | |
opts = [strategy: :one_for_one, name: ElixirContainerAgentExperiment.Supervisor] | |
Supervisor.start_link(children, opts) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ElixirContainerAgentExperiment do | |
require Logger | |
def hello do | |
Logger.info("Starting outer") | |
Task.Supervisor.async(ElixirContainerAgentExperiment.ExampleSupervisor, fn () -> | |
Logger.info("Starting inner") | |
:ok = Process.sleep(30000 * 3) | |
Logger.info("Finishing inner") | |
end) | |
Logger.info("Continuing outer") | |
:ok = Process.sleep(30000) | |
Logger.info("Finishing outer") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ElixirContainerAgentExperiment.ExampleSupervisor do | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment