Class GrpcGateway
- Namespace
- Microsoft.Auto
Gen .RuntimeGateway .Grpc
- Assembly
- Microsoft.AutoGen.RuntimeGateway.Grpc.dll
Represents the gRPC gateway service that handles communication between the agent worker and the cluster.
public sealed class GrpcGateway : BackgroundService, IHostedService, IDisposable, IGateway, IGrainObserver, IAddressable
- Inheritance
-
Grpc
Gateway
- Implements
- Inherited Members
Constructors
GrpcGateway(IClusterClient, ILogger<GrpcGateway>)
Initializes a new instance of the Grpc
Parameters
clusterClient
IClusterClient The cluster client.
logger
ILogger<GrpcGateway >The logger.
Fields
_controlWorkers
Field Value
_workers
Field Value
Methods
ExecuteAsync(CancellationToken)
Executes the background service.
Parameters
stoppingToken
CancellationToken The cancellation token.
Returns
- Task
A task that represents the asynchronous operation.
GetSubscriptionsAsync(GetSubscriptionsRequest, CancellationToken)
Gets the subscriptions asynchronously.
public ValueTask<List<Subscription>> GetSubscriptionsAsync(GetSubscriptionsRequest request, CancellationToken cancellationToken = default)
Parameters
request
GetSubscriptions Request The get subscriptions request.
cancellationToken
CancellationToken The cancellation token.
Returns
- Value
Task <List<Subscription>> A task that represents the asynchronous operation. The task result contains the list of subscriptions.
InvokeRequestAsync(RpcRequest, CancellationToken)
Invokes a request asynchronously.
public ValueTask<RpcResponse> InvokeRequestAsync(RpcRequest request, CancellationToken cancellationToken = default)
Parameters
request
RpcRequest The RPC request.
cancellationToken
CancellationToken The cancellation token.
Returns
- Value
Task <RpcResponse > A task that represents the asynchronous operation. The task result contains the RPC response.
RegisterAgentTypeAsync(RegisterAgentTypeRequest, ServerCallContext, CancellationToken)
Registers an agent type asynchronously.
public ValueTask<RegisterAgentTypeResponse> RegisterAgentTypeAsync(RegisterAgentTypeRequest request, ServerCallContext context, CancellationToken cancellationToken = default)
Parameters
request
RegisterAgent Type Request The register agent type request.
context
ServerCall Context The server call context.
cancellationToken
CancellationToken The cancellation token.
Returns
- Value
Task <RegisterAgent >Type Response A task that represents the asynchronous operation. The task result contains the register agent type response.
SubscribeAsync(AddSubscriptionRequest, CancellationToken)
Subscribes to a topic asynchronously.
public ValueTask<AddSubscriptionResponse> SubscribeAsync(AddSubscriptionRequest request, CancellationToken cancellationToken = default)
Parameters
request
AddSubscription Request The add subscription request.
cancellationToken
CancellationToken The cancellation token.
Returns
- Value
Task <AddSubscription >Response A task that represents the asynchronous operation. The task result contains the add subscription response.
UnsubscribeAsync(RemoveSubscriptionRequest, CancellationToken)
Unsubscribes from a topic asynchronously.
public ValueTask<RemoveSubscriptionResponse> UnsubscribeAsync(RemoveSubscriptionRequest request, CancellationToken cancellationToken = default)
Parameters
request
RemoveSubscription Request The remove subscription request.
cancellationToken
CancellationToken The cancellation token.
Returns
- Value
Task <RemoveSubscription >Response A task that represents the asynchronous operation. The task result contains the remove subscription response.