KeyedSignalTKey, TResultWait Method

Waits synchronously for the specified 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.147 -- Release Build+71918e29738e2d0700de8aec0ad72324b16f1428
public (TResult , Exception ex) Wait(
	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

ValueTupleTResult, Exception
A tuple where:
  • result is the signaled result when successful; otherwise default.
  • ex is null on success; otherwise the exception that caused the failure, including OperationCanceledException when canceled.

Remarks

A failure triggered by Fail(TKey, Exception) returns (default, ex) where ex is the exception provided to Fail(TKey, Exception).Cancellation is treated like a failure where returned ex is an OperationCanceledException.

For asynchronous waiting, use WaitAsync(TKey, CancellationToken).

Exceptions

ObjectDisposedExceptionThrown if the instance has been disposed.

See Also