Table of Contents

Class GrpcGateway

Namespace
Microsoft.AutoGen.Runtime.Grpc
Assembly
Microsoft.AutoGen.Runtime.Grpc.dll
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 IClusterClient
logger ILogger<GrpcGateway>

Fields

_workers

public readonly ConcurrentDictionary<IConnection, IConnection> _workers

Field Value

ConcurrentDictionary<IConnection, IConnection>

Methods

BroadcastEvent(CloudEvent)

public ValueTask BroadcastEvent(CloudEvent evt)

Parameters

evt CloudEvent

Returns

ValueTask

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 CancellationToken

Triggered when StopAsync(CancellationToken) is called.

Returns

Task

A Task that represents the long running operations.

Remarks

See Worker Services in .NET for implementation guidelines.

InvokeRequest(RpcRequest, CancellationToken)

public ValueTask<RpcResponse> InvokeRequest(RpcRequest request, CancellationToken cancellationToken = default)

Parameters

request RpcRequest
cancellationToken CancellationToken

Returns

ValueTask<RpcResponse>

ReadAsync(AgentId)

public ValueTask<AgentState> ReadAsync(AgentId agentId)

Parameters

agentId AgentId

Returns

ValueTask<AgentState>

SendMessageAsync(IConnection, CloudEvent, CancellationToken)

public Task SendMessageAsync(IConnection connection, CloudEvent cloudEvent, CancellationToken cancellationToken = default)

Parameters

connection IConnection
cloudEvent CloudEvent
cancellationToken CancellationToken

Returns

Task

StoreAsync(AgentState)

public ValueTask StoreAsync(AgentState value)

Parameters

value AgentState

Returns

ValueTask