[concurrency-interest] draft Carrier API

Doug Lea dl at cs.oswego.edu
Sun Mar 8 13:37:34 UTC 2020


On 3/8/20 8:49 AM, Alex Otenko via Concurrency-interest wrote:
> I think it may be useful to clarify who is meant to call each of the
> close methods.

Right; thanks especially for the questions about what confused
programmers who aren't used to dealing with half-closed states might do.
 Probably best to stop using "close" except for full close. And kill
closeForReceiving. Leaving better names and simpler specs:

interface Carriable<T> extends AutoCloseable {
    boolean isClosed();
    boolean isFinishedSending();    // closed or sending disabled
    //...
}
interface CarrierSender<T> extends Carriable<T> {
    void finishSending();           // disable sending; close when empty
    // ...
}

Full versions as usual at: http://gee.cs.oswego.edu/dl/wwwtmp/Carrier.java



More information about the loom-dev mailing list