View Source Chorex.Proxy (Chorex v0.4.3)
Proxy for singletons in a choreography.
Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.init/1
.
Send a message to a proxied service.
Updates the session state for the current process.
Types
@type session_key() :: term()
@type session_state() :: any()
@type state() :: %{ pid_session: %{required(pid()) => session_key()}, session_data: any(), session_handler: %{required(session_key()) => pid()} }
Functions
Link to this function
begin_session(proxy, session_pids, proxy_module, start_func, start_args)
View SourceReturns a specification to start this module under a supervisor.
See Supervisor
.
Callback implementation for GenServer.init/1
.
Send a message to a proxied service.
Handles the wrapping of the message with the {:chorex, self(), ...}
tuple so that the proxy knows which session to send the message on to.
@spec update_state(map(), (session_state() -> {any(), session_state()})) :: any()
Updates the session state for the current process.
For use by proxied processes.