KeyedSignalTKey, TResultWaitAsync Method
Asynchronously waits for key to be signaled (or failed).
Multiple concurrent waiters on the same key complete together.
Namespace: Gemstone.ThreadingAssembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.141 -- Release Build+5e2ec463438f5de09767d41cb13e56e90c503d09
public Task<TResult> WaitAsync(
TKey key,
CancellationToken cancellationToken = default
)
Public Function WaitAsync (
key As TKey,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of TResult)
public:
Task<TResult>^ WaitAsync(
TKey key,
CancellationToken cancellationToken = CancellationToken()
)
function WaitAsync(key, cancellationToken);
- key TKey
- Key to wait on.
- cancellationToken CancellationToken (Optional)
- Optional token to cancel or timeout the wait.
TaskTResultA task that completes when signaled, failed, or canceled.
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.
ObjectDisposedException | Thrown if the instance has been disposed. |