jhn_elixir v0.1.2 JhnElixir.GenStatem behaviour

Link to this section Summary

Link to this section Types

Link to this type

action()

action() ::
  :postpone
  | {:postpone, boolean()}
  | {:next_event, event_type(), term()}
  | :hibernate
  | {:hibernate, boolean()}
  | timeout_action()
  | reply_action()
Link to this type

callback_mode()

callback_mode() :: :state_functions | :handle_event_function
Link to this type

debug()

debug() :: [:trace | :log | :statistics | {:log_to_file, Path.t()}]
Link to this type

event_type()

event_type() :: external_event_type() | timeout_event_type() | :internal
Link to this type

external_event_type()

external_event_type() :: {:call, from()} | :cast | :info
Link to this type

from()

from() :: {pid(), tag :: term()}
Link to this type

link()

link() :: :link | :nolink
Link to this type

name()

name() :: atom() | {:global, term()} | {:via, module(), term()}
Link to this type

on_start()

on_start() ::
  {:ok, pid()} | :ignore | {:error, {:already_started, pid()} | term()}
Link to this type

option()

option() ::
  {:name, name()}
  | {:link, link()}
  | {:debug, debug()}
  | {:timeout, timeout()}
  | {:spawn_opt, Process.spawn_opt()}
  | {:hibernate_after, timeout()}
Link to this type

options()

options() :: [option()]
Link to this type

reply_action()

reply_action() :: {:reply, from(), term()}
Link to this type

server()

server() :: pid() | name() | {atom(), node()}
Link to this type

timeout_action()

timeout_action() :: term()
Link to this type

timeout_event_type()

timeout_event_type() :: :timeout | {:timeout, term()} | :state_timeout

Link to this section Functions

Link to this function

call(server, request, timeout \\ 5000)

call(server(), term(), timeout()) :: term()
Link to this function

cast(server, message)

cast(server(), term()) :: :ok
Link to this function

reply(reply_actions)

reply(reply_action() | [reply_action()]) :: :ok
Link to this function

reply(from, reply)

reply(from(), term()) :: :ok
Link to this function

start(module, init_arg, options \\ [])

start(module(), any(), options()) :: on_start()
Link to this function

stop(server, reason \\ :normal, timeout \\ :infinity)

stop(server(), reason :: term(), timeout()) :: :ok

Link to this section Callbacks

Link to this callback

callback_mode()

callback_mode() :: callback_mode() | [callback_mode() | :state_enter]
Link to this callback

code_change(old_vsn, state, extra)

code_change(old_vsn, state :: term(), extra :: term()) ::
  {:ok, new_state :: term()} | {:error, reason :: term()}
when old_vsn: term() | {:down, term()}
Link to this callback

format_status(reason, pdict_and_state)

format_status(reason, pdict_and_state :: list()) :: term()
when reason: :normal | :terminate
Link to this callback

init(init_arg)

init(init_arg :: term()) ::
  {:ok, state, data}
  | {:ok, state, data, actions :: action() | [action()]}
  | :ignore
  | {:stop, reason :: any()}
when state: atom(), data: any()
Link to this callback

terminate(reason, state)

terminate(reason, state :: term()) :: term()
when reason: :normal | :shutdown | {:shutdown, term()} | term()