Interface IRequestAdmission
- Namespace
- AnyProtocol.Abstraction
- Assembly
- AnyProtocol.Abstraction.dll
Coordinates admission of work during an application drain.
public interface IRequestAdmission
Properties
ActiveCount
Gets the number of admitted operations that have not exited yet.
int ActiveCount { get; }
Property Value
IsDraining
Gets a value indicating whether new work is being rejected.
bool IsDraining { get; }
Property Value
Methods
BeginDrain()
Atomically prevents new work from entering and returns the drain linearization point.
void BeginDrain()
StartAccepting()
Starts a new accepting lifecycle.
void StartAccepting()
TryEnter()
Attempts to admit work.
IAdmissionLease? TryEnter()
Returns
- IAdmissionLease
A lease when admitted; otherwise null.
WaitForIdleAsync(TimeSpan, CancellationToken)
Waits until all admitted work has exited or the timeout expires.
ValueTask<bool> WaitForIdleAsync(TimeSpan timeout, CancellationToken cancellationToken = default)
Parameters
timeoutTimeSpanThe maximum wait duration.
cancellationTokenCancellationTokenThe cancellation token.