An unbuffered FIFO queue, brokered by Offers. Note that the queue is
ordered by successful operations, not initiations, so one and two
may not be received in that order with this code:
val b: Broker[Int]
b ! 1
b ! 2
But rather we need to explicitly sequence them:
val b: Broker[Int]
for {
() <- b ! 1
() <- b ! 2
} ()
BUGS: the implementation would be much simpler in the absence of
cancellation.
An unbuffered FIFO queue, brokered by
Offer
s. Note that the queue is ordered by successful operations, not initiations, soone
andtwo
may not be received in that order with this code:But rather we need to explicitly sequence them:
BUGS: the implementation would be much simpler in the absence of cancellation.