src/Foundation/Infrastructure/Gimela.Infrastructure.AsyncModel/AsyncWaiter/AsyncWaiter.cs
/// <summary>
/// Waits the specified token and with the specified state data.
/// </summary>
/// <param name="token">The asynchronous token.</param>
/// <param name="state">The user defined state data.</param>
Waits the specified token and with the specified state data.
Waits the specified token and with the specified state data .
public void Wait(AsyncToken<TToken> token, TState state)
    {
      lock (syncRoot)
      {
        if (waiter.ContainsKey(token))
          throw new InvalidProgramException("Invalid async token, the same key already exists.");
        waiter[token] = state;
      }
    }
public void Wait ( AsyncToken < TToken > token , TState state ) { lock ( syncRoot ) { if ( waiter . ContainsKey ( token ) ) throw new InvalidProgramException ( " " ) ; waiter [ token ] = state ; } }
Waits the specified token and with the specified state data.
Waits the specified token and with the specified state data .
token
AsyncToken<TToken>
The asynchronous token.
The asynchronous token .
state
TState
The user defined state data.
The user defined state data .