Beispiel #1
0
 public static void AssertChanNotClosed <T>(IChan <T> chan)
 {
     if (chan.IsClosed)
     {
         throw new InvalidOperationException("The chan has been closed");
     }
 }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="size">null or an integer no less than 1. if null or not specified, an unbuffered chan will be created.</param>
 public Chan(int?size = null)
 {
     if (size.HasValue)
     {
         _chan = new BufferedChan <T>(size.Value);
     }
     else
     {
         _chan = new UnbufferedChan <T>();
     }
 }
Beispiel #3
0
 public ChanYieldEnumerator(IChan <T> target, CancellationToken cancellationToken)
 {
     _target            = target;
     _cancellationToken = cancellationToken;
 }