defmodule JobServer do
use GenServer
def handle_continue(:stop_from_supervisor, state) do
:ok = JobServer.Supervisor.stop_child(self(), state)
{:noreply, state}
end
end
defmodule JobServer.Supervisor do
def stop_child(child, state) do
dump_state(state)
DynamicSupervisor.terminate_child(__MODULE__, child)
end
end