Method TryOpenAsync
- Namespace
- MailFathom.Application.Discovery.Streaming
- Assembly
- MailFathom.Application.dll
TryOpenAsync(DiscoveryRunId, UserId, DateTimeOffset, CancellationToken)
Opens a run for one user, unless that person is already running as many as they may.
Task<bool> TryOpenAsync(DiscoveryRunId id, UserId user, DateTimeOffset now, CancellationToken cancellationToken)
Parameters
idDiscoveryRunIdThe identifier the run will be addressed by.
userUserIdWhose mail the run will read, which is who may read what it writes.
nowDateTimeOffsetThe instant the run starts, which its retention and its ceiling are both measured from.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<bool>
true when the run was opened; false when this person is at MaximumConcurrentRunsPerUser.
Remarks
The bound is one person's across the whole deployment rather than one process's, which is what lets a client be told a number that means something: what somebody may start no longer depends on which replica the start request reached.