Create a pair of queue-based I/O channel endpoints.
Create a pair of queue-based I/O channel endpoints.
Execution context for internal Promise
/Future
handling
Spawn two functions as threads communicating via a pair of queue-based channel endpoints.
Spawn two functions as threads communicating via a pair of queue-based channel endpoints.
This method invokes factory to create a pair of channel endpoints
(in,out)
, and then spawns p1(in)
and p2(out)
.
Function using the input channel endpoint
Function using the output channel endpoint
Execution context where the p1
and p2
will run
A pair of Future
s (f1, f2)
, completed respectively when
p1(in)
and p2(out)
terminate.
Channel endpoints for local use, based on Java
LinkedTransferQueue
s.Queue-based channels are (almost) a drop-in replacement for LocalChannels. They are optimized for bypassing Out.promise and In.future whenever possible, e.g. when a program mostly calls Out.send and In.receive; as a consequence, if QueueOut.promise or QueueIn.future are used, the performance will be impacted.
NOTE: due to limitations of Java
LinkedTransferQueue
s, invoking QueueIn.receive on aQueueIn[Null]
instance with a finite wait time will cause a spurious timeout error. If you really need channel endpoints that carryNull
values, you should use LocalChannels.