Interface IGatewayRegistry
- Namespace
- Microsoft.AutoGen.RuntimeGateway.Grpc.Abstractions
- Assembly
- Microsoft.AutoGen.RuntimeGateway.Grpc.dll
Keeps track of which agents are registered with which gateways.
public interface IGatewayRegistry : IRegistry
- Inherited Members
Methods
AddWorkerAsync(IGateway)
Adds a new worker to the registry.
ValueTask AddWorkerAsync(IGateway worker)
Parameters
workerIGatewayThe worker to add.
Returns
- ValueTask
A task representing the asynchronous operation.
GetCompatibleWorkerAsync(string)
Gets a compatible worker for the specified agent type.
ValueTask<IGateway?> GetCompatibleWorkerAsync(string type)
Parameters
typestringThe type of the agent.
Returns
- ValueTask<IGateway>
A task representing the asynchronous operation, with the compatible worker as the result.
GetOrPlaceAgent(AgentId)
Gets or places an agent based on the provided agent ID.
ValueTask<(IGateway? Worker, bool NewPlacement)> GetOrPlaceAgent(AgentId agentId)
Parameters
agentIdAgentIdThe ID of the agent.
Returns
- ValueTask<(IGateway Worker, bool NewPlacement)>
A tuple containing the worker and a boolean indicating if it's a new placement.
RegisterAgentTypeAsync(RegisterAgentTypeRequest, string, IGateway)
Registers a new agent type with the specified worker.
ValueTask RegisterAgentTypeAsync(RegisterAgentTypeRequest request, string clientId, IGateway worker)
Parameters
requestRegisterAgentTypeRequestThe request containing agent type details.
clientIdstringThe client ID of the worker.
workerIGatewayThe worker to register the agent type with.
Returns
- ValueTask
A task representing the asynchronous operation.
RemoveWorkerAsync(IGateway)
Removes a worker from the registry.
ValueTask RemoveWorkerAsync(IGateway worker)
Parameters
workerIGatewayThe worker to remove.
Returns
- ValueTask
A task representing the asynchronous operation.