Class GrpcAgentWorker
public sealed class GrpcAgentWorker : IHostedService, IDisposable, IAgentWorker
- Inheritance
-
GrpcAgentWorker
- Implements
- Inherited Members
Constructors
GrpcAgentWorker(AgentRpcClient, IHostApplicationLifetime, IServiceProvider, IEnumerable<Tuple<string, Type>>, ILogger<GrpcAgentWorker>)
public GrpcAgentWorker(AgentRpc.AgentRpcClient client, IHostApplicationLifetime hostApplicationLifetime, IServiceProvider serviceProvider, IEnumerable<Tuple<string, Type>> configuredAgentTypes, ILogger<GrpcAgentWorker> logger)
Parameters
clientAgentRpc.AgentRpcClienthostApplicationLifetimeIHostApplicationLifetimeserviceProviderIServiceProviderconfiguredAgentTypesIEnumerable<Tuple<string, Type>>loggerILogger<GrpcAgentWorker>
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
PublishEventAsync(CloudEvent, CancellationToken)
public ValueTask PublishEventAsync(CloudEvent @event, CancellationToken cancellationToken = default)
Parameters
eventCloudEventcancellationTokenCancellationToken
Returns
ReadAsync(AgentId, CancellationToken)
public ValueTask<AgentState> ReadAsync(AgentId agentId, CancellationToken cancellationToken = default)
Parameters
agentIdAgentIdcancellationTokenCancellationToken
Returns
SendMessageAsync(Message, CancellationToken)
public ValueTask SendMessageAsync(Message message, CancellationToken cancellationToken = default)
Parameters
messageMessagecancellationTokenCancellationToken
Returns
SendRequestAsync(Agent, RpcRequest, CancellationToken)
public ValueTask SendRequestAsync(Agent agent, RpcRequest request, CancellationToken cancellationToken = default)
Parameters
agentAgentrequestRpcRequestcancellationTokenCancellationToken
Returns
SendResponseAsync(RpcResponse, CancellationToken)
public ValueTask SendResponseAsync(RpcResponse response, CancellationToken cancellationToken = default)
Parameters
responseRpcResponsecancellationTokenCancellationToken
Returns
StartAsync(CancellationToken)
Triggered when the application host is ready to start the service.
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the start process has been aborted.
Returns
StopAsync(CancellationToken)
Triggered when the application host is performing a graceful shutdown.
public Task StopAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the shutdown process should no longer be graceful.
Returns
StoreAsync(AgentState, CancellationToken)
public ValueTask StoreAsync(AgentState value, CancellationToken cancellationToken = default)
Parameters
valueAgentStatecancellationTokenCancellationToken