Skip to content

Is there a simple way to resurrect UnbufferedChannels? #48131

Answered by stephentoub
jcoo092 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. You could copy out the old code and try to fix it up to meet your needs (the relevant APIs are virtual to enable creating custom channels), but some aspects of the model don't fit well with the concept, which is one of the reasons it was removed. For example, if a writer is only ever using TryWrite and a reader is only ever using TryRead, given the synchronization required they'll never show up as being there at the same time and thus will never successfully rendezvous. Similarly, if for example a reader was in a loop that did WaitToReadAsync and then a TryRead, it will similarly only work if a writer did a write with WriteAsync; if the writer only ever wrote with TryWrite, they would…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jcoo092
Comment options

@shartley-qontigo
Comment options

@stephentoub
Comment options

Answer selected by jcoo092
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants