Class WorkManagerGroupCheck
IGroupExistenceCheck through the WorkManager, which keeps the groups
(openspec groups-and-topology, design decision 2): GetGroup{id} for each group, by
the gateway's own route to its backends (GrpcReflectionService, as
Gateway.InvokeJson), so the api depends on no WorkManager type. A group that does not
exist fails with GroupNotFound; one whose deletion has started
(Group.deleting) takes no members, as the WorkManager refuses it too, and fails with
Deleting. A WorkManager that does not answer is
Unavailable: the group is not taken for granted.
public sealed class WorkManagerGroupCheck : IGroupExistenceCheck
- Inheritance
-
WorkManagerGroupCheck
- Implements
- Inherited Members
Constructors
WorkManagerGroupCheck(Func<string, CancellationToken, Task<GrpcCallResult>>)
IGroupExistenceCheck through the WorkManager, which keeps the groups
(openspec groups-and-topology, design decision 2): GetGroup{id} for each group, by
the gateway's own route to its backends (GrpcReflectionService, as
Gateway.InvokeJson), so the api depends on no WorkManager type. A group that does not
exist fails with GroupNotFound; one whose deletion has started
(Group.deleting) takes no members, as the WorkManager refuses it too, and fails with
Deleting. A WorkManager that does not answer is
Unavailable: the group is not taken for granted.
public WorkManagerGroupCheck(Func<string, CancellationToken, Task<GrpcCallResult>> getGroup)
Parameters
getGroupFunc<string, CancellationToken, Task<GrpcCallResult>>Calls the WorkManager's
GetGroupwith a JSON request (proto field names).
WorkManagerGroupCheck(GrpcReflectionService)
The check over the gateway's reflection route to the WorkManager.
public WorkManagerGroupCheck(GrpcReflectionService backends)
Parameters
backendsGrpcReflectionService
Fields
GetGroupMethod
The WorkManager method that reads one group.
public const string GetGroupMethod = "GetGroup"
Field Value
WorkManagerService
The WorkManager's name in services.json.
public const string WorkManagerService = "workmanager"
Field Value
Methods
EnsureExistAsync(IReadOnlyCollection<string>, CancellationToken)
Throws, for the first of groups that does not exist,
FAILED_PRECONDITION with reason GroupNotFound
and the group as resource; for one being deleted, reason
Deleting.
public Task EnsureExistAsync(IReadOnlyCollection<string> groups, CancellationToken cancellationToken)
Parameters
groupsIReadOnlyCollection<string>cancellationTokenCancellationToken