KeyedSignalTKey, TResult Class

Represents a wait-by-key async signaling operation that can work with multiple concurrent waiters per key. Multiple callers await a task associated with a key; another single thread then signals completion with a result or failure with an exception for that key.

Definition

Namespace: Gemstone.Threading
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.141 -- Release Build+5e2ec463438f5de09767d41cb13e56e90c503d09
public sealed class KeyedSignal<TKey, TResult> : IDisposable, 
	IAsyncDisposable
Inheritance
Object    KeyedSignalTKey, TResult
Implements
IAsyncDisposable, IDisposable

Type Parameters

TKey
Key type, e.g., a Guid.
TResult
Result type delivered to all waiters when signaled.

Remarks

Pruning happens periodically to avoid orphaned waiters when all callers timeout from no signal.

Constructors

KeyedSignalTKey, TResult Creates a new instance of the KeyedSignalTKey, TResult class.

Properties

PendingKeysCount Gets the number of pending keys that have waiters.

Methods

Dispose Releases all the resources used by the KeyedSignalTKey, TResult object.
DisposeAsync Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Fail Fails all current waiters for key with ex. New waiters added after this call for same key will await a subsequent signal/fail.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
Signal Signals all current waiters for key with result. New waiters added after this call for same key will await a subsequent signal/fail.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryFail Tries to fail all current waiters for key with ex. New waiters added after this call for same key will await a subsequent signal/fail.
TrySignal Tries to signal all current waiters for key with result. New waiters added after this call for same key will await a subsequent signal/fail.
Wait Waits synchronously for the specified key to be signaled or failed. Multiple concurrent waiters on the same key complete together.
WaitAsync Asynchronously waits for key to be signaled (or failed). Multiple concurrent waiters on the same key complete together.

See Also