Professional Documents
Culture Documents
returns
def start_link(opts \\ []) do {:ok, pid}
client
def init(match_this) do
# process input and compute result
result
end
applies globally
ˆresult =
{:ok, state}
ˆreason =
{:ok, state, then_what} One of :normal, :shutdown,
{:shutdown, _}, or any other
{:stop, reason} value. See the footnote for a link to
:ignore the complete reference.
applies globally
ˆthen what =
ˆresult =
{:noreply, state}
{:noreply, state, then_what} timeout_milliseconds
:hibernate
{:stop, reason, state} {:continue, match_this}
synchronous operation: .call → handle call/3
returns
def your_api_sync_op(pid, args) do
client
{:noreply, state}
ˆreply =
{:noreply, state, then_what}
user defined
{:stop, reason, reply, state}
{:noreply, state}
{:noreply, state, then_what}
{:noreply, state}
{:noreply, state, then_what}
footnotes