Gemstone Threading Library
Show/Hide TOC

# KeyedSignal TKey, 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.162 -- Release Build+7fb59487e2752bb14cc6b30d8b8d9d6a88cf222f
C#
View Source Request Example

    public sealed class KeyedSignal<TKey, TResult> : IDisposable,
    	IAsyncDisposable

VB
View Source Request Example

    Public NotInheritable Class KeyedSignal(Of TKey, TResult)
    	Implements IDisposable, IAsyncDisposable

C++
View Source Request Example

    generic<typename TKey, typename TResult>
    public ref class KeyedSignal sealed : IDisposable,
    	IAsyncDisposable

JavaScript
View Source Request Example

    JavaScript does not support generic types or methods.

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.
Equals | Determines 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.
GetHashCode | Serves as the default hash function. (Inherited from Object)
GetType | Gets 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.
ToString | Returns 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

#### Reference

Gemstone.Threading Namespace