Re: draft Carrier API

Doug Lea via Concurrency-interest <[email protected]> Sun, 8 Mar 2020 07:54:24 -0400
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
On 3/7/20 6:25 PM, Alex Otenko wrote:
> Send is declared to throw when is closed for sending. Is there a good
> reason to not throw when is closed for receiving? Or what is the
> intended behavior in this case, given that it may block if full?
> 

Normally, a completed receiver should invoke (bidirectional) close.
Calling closeForReceiving provides more flexibility, but with more cases
for users to consider (like stuck senders).

But this question invites considering whether even having
closeForReceiving would lead to more errors than correct usages.
Considering that some of the motivation for Carrier is to reduce
opportunities for errors people encounter with hand-made components
built from BlockingQueues etc, I think we could remove it.

-Doug


_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest