Class AgentWorker
public class AgentWorker : IHostedService, IAgentWorker
- Inheritance
-
AgentWorker
- Implements
- Inherited Members
Constructors
AgentWorker(IHostApplicationLifetime, IServiceProvider, IEnumerable<Tuple<string, Type>>)
public AgentWorker(IHostApplicationLifetime hostApplicationLifetime, IServiceProvider serviceProvider, IEnumerable<Tuple<string, Type>> configuredAgentTypes)
Parameters
hostApplicationLifetime
IHostApplicationLifetimeserviceProvider
IServiceProviderconfiguredAgentTypes
IEnumerable<Tuple<string, Type>>
Methods
PublishEventAsync(CloudEvent, CancellationToken)
public ValueTask PublishEventAsync(CloudEvent cloudEvent, CancellationToken cancellationToken = default)
Parameters
cloudEvent
CloudEventcancellationToken
CancellationToken
Returns
ReadAsync(AgentId, CancellationToken)
public ValueTask<AgentState> ReadAsync(AgentId agentId, CancellationToken cancellationToken = default)
Parameters
agentId
AgentIdcancellationToken
CancellationToken
Returns
RunMessagePump()
public Task RunMessagePump()
Returns
SendMessageAsync(Message, CancellationToken)
public ValueTask SendMessageAsync(Message message, CancellationToken cancellationToken = default)
Parameters
message
MessagecancellationToken
CancellationToken
Returns
SendRequestAsync(Agent, RpcRequest, CancellationToken)
public ValueTask SendRequestAsync(Agent agent, RpcRequest request, CancellationToken cancellationToken = default)
Parameters
agent
Agentrequest
RpcRequestcancellationToken
CancellationToken
Returns
SendResponseAsync(RpcResponse, CancellationToken)
public ValueTask SendResponseAsync(RpcResponse response, CancellationToken cancellationToken = default)
Parameters
response
RpcResponsecancellationToken
CancellationToken
Returns
StartAsync(CancellationToken)
Triggered when the application host is ready to start the service.
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenIndicates 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
cancellationToken
CancellationTokenIndicates that the shutdown process should no longer be graceful.
Returns
StoreAsync(AgentState, CancellationToken)
public ValueTask StoreAsync(AgentState value, CancellationToken cancellationToken = default)
Parameters
value
AgentStatecancellationToken
CancellationToken