Exemplo n.º 1
0
 private static void DequeueLoop()
 {
     foreach (CorrelationItem <string> item in ResponseChannel.GetConsumingEnumerable())
     {
         Console.WriteLine($"{item.Value} [{item.Correlation:N}]");
     }
 }
Exemplo n.º 2
0
 private void WatchLoop()
 {
     foreach (var response in ResponseChannel.GetConsumingEnumerable())
     {
         if (_map.TryRemove(response.Correlation,
                            out TaskCompletionSource <string> tcs))
         {
             tcs.TrySetResult(response.Value);
         }
     }
 }