Agent.stop
You're seeing just the function
stop
, go back to Agent module for more information.
Specs
Synchronously stops the agent with the given reason
.
It returns :ok
if the agent terminates with the given
reason. If the agent terminates with another reason, the call will
exit.
This function keeps OTP semantics regarding error reporting.
If the reason is any other than :normal
, :shutdown
or
{:shutdown, _}
, an error report will be logged.
Examples
iex> {:ok, pid} = Agent.start_link(fn -> 42 end)
iex> Agent.stop(pid)
:ok