Initial implementation of System.Threading.Tasks.Channels #335
Conversation
I think this line in the README:
would be less confusing as:
Also, I would really like to see a separate |
Yes, that's just a typo, I'll fix it.
Yes, I included it here simply as a convenient place to put it. If it were to be included in the framework, it would certainly be put somewhere more general, especially with language support depending on it.
Didn't quite understand this... SimpleQueue isn't a deque, it's just a regular queue without some of the (small) overheads of |
Prototype of a new System.Threading.Tasks.Channels library, which provides data structures for handing off data between producers and consumers. The included README.md provides an overview of the library and its exposed functionality. An initial set of functional tests are included, with ~95% line and branch coverage. Further work is desired to expose more operations over channels, provide additional built-in channel implementations, and optimize the existing channel and operator implementations further.
f7ff3cc
to
f4e82da
Compare
You're right, of course. Not sure why I was thinking it was a deque. :) |
/// <summary>A task completed when the channel is done.</summary> | ||
private readonly TaskCompletionSource<VoidResult> _completion = new TaskCompletionSource<VoidResult>(TaskCreationOptions.RunContinuationsAsynchronously); | ||
/// <summary>The wrapped enumerator.</summary> | ||
private readonly IEnumerator<T> _source; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This enumerator is never disposed. Shouldn't it be disposed when the channel is complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Yup, it should. I'll fix that.
Initial implementation of System.Threading.Tasks.Channels
Just a quick note to say the link to the readme in the first post is now broken - it should be to https://github.com/stephentoub/corefxlab/tree/master/src/System.Threading.Tasks.Channels (and possibly having README.md tack on there if you wish) instead of https://github.com/stephentoub/corefxlab/blob/initial_channels/src/System.Threading.Tasks.Channels/README.md |
Thanks, @IanYates. I've now fixed the link. |
I think a sentence or two on what's |
Sure, I can add that.
Probably not. I likely just neglected to remove the |
Prototype of a new System.Threading.Tasks.Channels library, which provides data structures for handing off data between producers and consumers. The included README.md provides an overview of the library and its exposed functionality.
An initial set of functional tests are included, with ~95% line and branch coverage.
Further work is desired to expose more operations over channels, provide additional built-in channel implementations, and optimize the existing channel and operator implementations further.