ExActor.Responders

Helper macros that can be used for simpler responses from init/call/cast/info handlers.

Source

Summary

hibernate()

Ensures that :hibernate will be included in each return tuple

initial_state(state, timeout \\ nil)

Sets the initial state

new_state(state, timeout \\ nil)

Sets the new state

noreply(timeout \\ nil)

Leaves the state unchanged

reply(response, timeout \\ nil)

Replies without changing the state

set_and_reply(new_state, response, timeout \\ nil)

Replies and sets the new state

stop_server(reason)

Stops the server

timeout_after(time_ms)

Ensures that timeout will be included in each return tuple

Macros

hibernate()

Ensures that :hibernate will be included in each return tuple.

Must be called from ExActor.Operations.defstart/2 (or definit).

This works only for return tuples made by macros from this module. If you're creating standard gen_server response manually, it's your responsibility to include the :hibernate, or override it if you want to.

Source
initial_state(state, timeout \\ nil)

Sets the initial state.

Applicable in:

Source
reply(response, timeout \\ nil)

Replies without changing the state.

Applicable in:

Source
set_and_reply(new_state, response, timeout \\ nil)

Replies and sets the new state

Applicable in:

Source
timeout_after(time_ms)

Ensures that timeout will be included in each return tuple.

Must be called from ExActor.Operations.defstart/2 (or definit).

This works only for return tuples made by macros from this module. If you're creating standard gen_server response manually, it's your responsibility to include the timeout, or override it if you want to.

Source