pub struct GrpcShared<PC, PR> { /* private fields */ }
Expand description

The server side gRPC implementation that will run in computed or storaged.

There are two main tasks involved: The gRPC callback implementations will execute in their own tasks, receive commands from the network and send responses to the network. Upon reception of a command, the implementation will put it in a mpsc queue, out of which the consumer (running in another task) will read it with a recv call. The same goes for the send path: The consumer calls send which puts the response in a mpsc queue, from which the gRPC stubs will read and send it over the network.

If an error occurs, the consumer receives an error from the recv call. If no client is connected recv will block until a client is available. To implement the “waiting for client” the queue_change notification is used. recv will check first if a client is connected using queue. If queue is None, no client is connected and recv will await on the queue_change notification. The server does this vice-versa. Upon connection of a client, it will insert the endpoints into queue and trigger the queue_change, which will wake up the waiting clients.

This is the shared datastructure between server and consumer.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more