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
worker
IGatewayThe 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
type
stringThe 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
agentId
AgentIdThe 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
request
RegisterAgentTypeRequestThe request containing agent type details.
clientId
stringThe client ID of the worker.
worker
IGatewayThe 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
worker
IGatewayThe worker to remove.
Returns
- ValueTask
A task representing the asynchronous operation.