Class GrpcGateway
public sealed class GrpcGateway : BackgroundService, IHostedService, IDisposable, IGateway, IGrainObserver, IAddressable
- Inheritance
-
GrpcGateway
- Implements
- Inherited Members
Constructors
GrpcGateway(IClusterClient, ILogger<GrpcGateway>)
public GrpcGateway(IClusterClient clusterClient, ILogger<GrpcGateway> logger)
Parameters
clusterClient
IClusterClientlogger
ILogger<GrpcGateway>
Fields
_workers
public readonly ConcurrentDictionary<IConnection, IConnection> _workers
Field Value
Methods
BroadcastEvent(CloudEvent)
public ValueTask BroadcastEvent(CloudEvent evt)
Parameters
evt
CloudEvent
Returns
ExecuteAsync(CancellationToken)
This method is called when the IHostedService starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.
protected override Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
stoppingToken
CancellationTokenTriggered when StopAsync(CancellationToken) is called.
Returns
Remarks
See Worker Services in .NET for implementation guidelines.
InvokeRequest(RpcRequest, CancellationToken)
public ValueTask<RpcResponse> InvokeRequest(RpcRequest request, CancellationToken cancellationToken = default)
Parameters
request
RpcRequestcancellationToken
CancellationToken
Returns
ReadAsync(AgentId)
public ValueTask<AgentState> ReadAsync(AgentId agentId)
Parameters
agentId
AgentId
Returns
SendMessageAsync(IConnection, CloudEvent, CancellationToken)
public Task SendMessageAsync(IConnection connection, CloudEvent cloudEvent, CancellationToken cancellationToken = default)
Parameters
connection
IConnectioncloudEvent
CloudEventcancellationToken
CancellationToken
Returns
StoreAsync(AgentState)
public ValueTask StoreAsync(AgentState value)
Parameters
value
AgentState