コード例 #1
0
 public bool MoveNext()
 {
     try
     {
         Current = _target.Receive(_cancellationToken);
         return(true);
     }
     catch (OperationCanceledException)
     {
         return(false);
     }
     catch (InvalidOperationException)
     {
         return(false);
     }
 }
コード例 #2
0
 /// <summary>
 ///     Removes and returns an item from channel. If the channel is empty, this will block the current thread,
 ///     until an item is sent into the channel.
 /// </summary>
 /// <returns></returns>
 public T Receive()
 {
     return(_chan.Receive());
 }