Skip to content

Instantly share code, notes, and snippets.

@stevejgordon
Created October 14, 2020 08:32
Show Gist options
  • Save stevejgordon/d224dedd7f68a0859e9bada8f4dcce6a to your computer and use it in GitHub Desktop.
Save stevejgordon/d224dedd7f68a0859e9bada8f4dcce6a to your computer and use it in GitHub Desktop.
public override bool TryRead([MaybeNullWhen(false)] out T item)
{
UnboundedChannel<T> parent = _parent;
// Dequeue an item if we can
if (parent._items.TryDequeue(out item))
{
CompleteIfDone(parent);
return true;
}
item = default;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment