retort v2.1.0 Retort.Server.Generic.Resources
Exposes an Ecto.Schema.t
as a JSONAPI resource over JSON RPC on a RabbitMQ queue.
Any code with side-effects, such as Logger
or Repo
calls should stay in this module. Any pure functions that
write back to the Retort.Server.Generic.RPC.t
can be in Retort.Server.Generic.RPC
.
Summary
Functions
Should match on rpc.decoded.method
and return rpc with rpc.response.decoded.result
set
Sets connection, channel, and queue to Rabbit
Functions
handle_method(r_p_c, calcinator)
handle_method(%Retort.Server.Generic.RPC{assigns: term, halted: true, meta: term, request: term, response: term, timing: term} | %Retort.Server.Generic.RPC{assigns: term, halted: false, meta: term, request: %{decoded: %Retort.Request{id: term, jsonrpc: term, method: binary, params: map}}, response: term, timing: term}, Calcinator.t) :: Retort.Server.Generic.RPC.t
Should match on rpc.decoded.method
and return rpc with rpc.response.decoded.result
set.
Callback implementation for Retort.Server.Generic.handle_method/2
.
Sets connection, channel, and queue to Rabbit