Table of Contents

Class AgentWorker

Namespace
Microsoft.AutoGen.Core
Assembly
Microsoft.AutoGen.Core.dll
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 IHostApplicationLifetime
serviceProvider IServiceProvider
configuredAgentTypes IEnumerable<Tuple<string, Type>>

Methods

PublishEventAsync(CloudEvent, CancellationToken)

public ValueTask PublishEventAsync(CloudEvent cloudEvent, CancellationToken cancellationToken = default)

Parameters

cloudEvent CloudEvent
cancellationToken CancellationToken

Returns

ValueTask

ReadAsync(AgentId, CancellationToken)

public ValueTask<AgentState> ReadAsync(AgentId agentId, CancellationToken cancellationToken = default)

Parameters

agentId AgentId
cancellationToken CancellationToken

Returns

ValueTask<AgentState>

RunMessagePump()

public Task RunMessagePump()

Returns

Task

SendMessageAsync(Message, CancellationToken)

public ValueTask SendMessageAsync(Message message, CancellationToken cancellationToken = default)

Parameters

message Message
cancellationToken CancellationToken

Returns

ValueTask

SendRequestAsync(Agent, RpcRequest, CancellationToken)

public ValueTask SendRequestAsync(Agent agent, RpcRequest request, CancellationToken cancellationToken = default)

Parameters

agent Agent
request RpcRequest
cancellationToken CancellationToken

Returns

ValueTask

SendResponseAsync(RpcResponse, CancellationToken)

public ValueTask SendResponseAsync(RpcResponse response, CancellationToken cancellationToken = default)

Parameters

response RpcResponse
cancellationToken CancellationToken

Returns

ValueTask

StartAsync(CancellationToken)

Triggered when the application host is ready to start the service.

public Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the start process has been aborted.

Returns

Task

A Task that represents the asynchronous Start operation.

StopAsync(CancellationToken)

Triggered when the application host is performing a graceful shutdown.

public Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the shutdown process should no longer be graceful.

Returns

Task

A Task that represents the asynchronous Stop operation.

StoreAsync(AgentState, CancellationToken)

public ValueTask StoreAsync(AgentState value, CancellationToken cancellationToken = default)

Parameters

value AgentState
cancellationToken CancellationToken

Returns

ValueTask