KeyedSignalTKey, TResultWaitAsync Method

Asynchronously waits for key to be signaled (or failed). Multiple concurrent waiters on the same key complete together.

Definition

Namespace: Gemstone.Threading
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.141 -- Release Build+5e2ec463438f5de09767d41cb13e56e90c503d09
public Task<TResult> WaitAsync(
	TKey key,
	CancellationToken cancellationToken = default
)

Parameters

key  TKey
Key to wait on.
cancellationToken  CancellationToken  (Optional)
Optional token to cancel or timeout the wait.

Return Value

TaskTResult
A task that completes when signaled, failed, or canceled.

Remarks

We never remove the per-key bucket on cancellation—only individual waiters. Buckets are removed on Signal(TKey, TResult)/Fail(TKey, Exception) or by periodic pruning. A mapping-stability check ensures we never add to an orphaned bucket.

Exceptions

ObjectDisposedExceptionThrown if the instance has been disposed.

See Also