ExActor v2.2.4 ExActor.Responders

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

Summary

Macros

Ensures that :hibernate will be included in each return tuple

Sets the initial state

Leaves the state unchanged

Replies without changing the state

Stops the server

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.

initial_state(state, timeout \\ nil)

Sets the initial state.

Applicable in:

reply(response, timeout \\ nil)

Replies without changing the state.

Applicable in:

set_and_reply(new_state, response, timeout \\ nil)

Replies and sets the new state

Applicable in:

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.