public bool MoveNext() { try { Current = _target.Receive(_cancellationToken); return(true); } catch (OperationCanceledException) { return(false); } catch (InvalidOperationException) { return(false); } }
/// <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()); }