ExActor.Responders
Helper macros that can be used for simpler responses from init/call/cast/info handlers.
Summary
hibernate() | Ensures that |
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
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.
Sets the new state.
Applicable in:
Leaves the state unchanged.
Applicable in:
Replies without changing the state.
Applicable in:
Replies and sets the new state
Applicable in:
Stops the server.
Applicable in:
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.