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
clusterClientIClusterClientloggerILogger<GrpcGateway>
Fields
_workers
public readonly ConcurrentDictionary<IConnection, IConnection> _workers
Field Value
Methods
BroadcastEvent(CloudEvent)
public ValueTask BroadcastEvent(CloudEvent evt)
Parameters
evtCloudEvent
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
stoppingTokenCancellationTokenTriggered 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
requestRpcRequestcancellationTokenCancellationToken
Returns
ReadAsync(AgentId)
public ValueTask<AgentState> ReadAsync(AgentId agentId)
Parameters
agentIdAgentId
Returns
SendMessageAsync(IConnection, CloudEvent, CancellationToken)
public Task SendMessageAsync(IConnection connection, CloudEvent cloudEvent, CancellationToken cancellationToken = default)
Parameters
connectionIConnectioncloudEventCloudEventcancellationTokenCancellationToken
Returns
StoreAsync(AgentState)
public ValueTask StoreAsync(AgentState value)
Parameters
valueAgentState