Table of Contents

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

int

IsDraining

Gets a value indicating whether new work is being rejected.

bool IsDraining { get; }

Property Value

bool

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

timeout TimeSpan

The maximum wait duration.

cancellationToken CancellationToken

The cancellation token.

Returns

ValueTask<bool>

true when the coordinator became idle.