Stone v0.2.0 Stone.Responders

Various macros useful for returning simpler responses from init/call/cast/info handlers.

Summary

Macros

Set initial state of the actor. Should be used in definit/defstart

Set initial state of the actor and timeout for initialization. Should be used in definit/defstart. Allows for setting a timeout

Return this, when you don’t care about the initial state of the actor. Should be used in definit/defstart

Macros

initial_state(state)

Set initial state of the actor. Should be used in definit/defstart.

Examples

iex> Stone.Responders.initial_state(1)
{:ok, 1}
initial_state(state, timeout)

Set initial state of the actor and timeout for initialization. Should be used in definit/defstart. Allows for setting a timeout.

Example

no_initial_state()

Return this, when you don’t care about the initial state of the actor. Should be used in definit/defstart.

Examples

iex> Stone.Responders.no_initial_state()
{:ok, nil}
noreply()
noreply_and_set(new_state)
reply(response)
reply_and_set(response, new_state)