View Source Sidecar.GRPC.Dispatcher (spawn v2.0.0-RC7)
Module for dispatching gRPC messages to Actors.
This module handles the dispatching of gRPC messages to Actors based on the provided parameters. It logs relevant information and raises an error if the service descriptor is not found.
Summary
Functions
Dispatches a gRPC message to the specified actor.
Functions
Dispatches a gRPC message to the specified actor.
Parameters:
request
- A map containing the following parameters:system: system_name
- The name of the actor system.actor_name: actor_name
- The name of the actor.action_name: action_name
- The name of action to call.input: message
- The input message.stream: stream
- The stream (optional).descriptor: descriptor
- The service descriptor.
Example:
request = %{
system: "spawn-system",
actor_name: "GreeterActor",
action_name: "SayHello",
input: %{data: "some_data"},
stream: %GRPC.Server.Stream{},
descriptor: %Google.Protobuf.FileDescriptorProto{
name: "helloworld.proto",
package: "helloworld"},
service: [
%Google.Protobuf.ServiceDescriptorProto{
name: "GreeterActor",
method: [
%Google.Protobuf.MethodDescriptorProto{
name: "SayHello",
input_type: ".helloworld.HelloRequest",
output_type: ".helloworld.HelloReply",
}
]
}
]
}
}
Sidecar.GRPC.Dispatcher.dispatch(request)