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.141 -- Release Build+5e2ec463438f5de09767d41cb13e56e90c503d09
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