Mesh.Request (Mesh v0.1.4)
View SourceRequest structure for invoking processes in Mesh.
Fields
:module- The GenServer module to invoke (required):id- The actor ID that identifies this specific process instance (required):payload- The payload to send to the process (required):capability- The capability that determines routing (required):init_arg- Optional argument passed to the process'sstart_link/2on creation
Examples
# Simple request
%Mesh.Request{
module: MyApp.Counter,
id: "counter_1",
payload: %{action: :increment},
capability: :counter
}
# With custom initialization argument
%Mesh.Request{
module: MyApp.GameActor,
id: "player_123",
payload: %{action: :get_state},
capability: :game,
init_arg: %{starting_level: 5}
}
Summary
Functions
Creates a new Request struct.
Types
Functions
Creates a new Request struct.
Examples
iex> Mesh.Request.new(MyApp.Counter, "counter_1", %{action: :increment}, :counter)
%Mesh.Request{module: MyApp.Counter, id: "counter_1", payload: %{action: :increment}, capability: :counter}
iex> Mesh.Request.new(MyApp.GameActor, "player_1", %{}, :game, init_arg: %{level: 10})
%Mesh.Request{module: MyApp.GameActor, id: "player_1", payload: %{}, capability: :game, init_arg: %{level: 10}}