ChannelActor - actor, which leave
ChannelActor - actor, which leave
ChannelActor - actor, which leave
add f
to list of callbacks, called on channel close.
add f
to list of callbacks, called on channel close.
result of CloseChannelRead, return number of elements left to read
this is message wich send to ChannelActor, when we know, that channel is closed.
this is message wich send to ChannelActor, when we know, that channel is closed. In such case, we don't konw: is actor stopped or not, So, we say this message (instead read) and wait for reply. If reply is not received within given timeout: think that channel is-dead.
read A and compute B as result.
write A and compute B as result
represent continuated computation from A to B.
Short name for use in fold signature
Builder for 'forever' selector.
Builder for 'forever' selector. Can be obtained as gopherApi.select.forever
.
Future[A], represented as input which produce a value when completed, after this closes.
Future[A], represented as input which produce a value when completed, after this closes. If evaluation of feature is unsuccessful (i.e. failure), than appropriative exception is thrown during reading.
Can be obtained from gopherApi.
import gopherApi._ val myInput = futureInput(future) select.forever{ case x: myInput.read => Console.println(s"we receive value from future: ${x}") implicitly[FlowTermination[Unit]].doExit(()) case x: myChannel.read => Console.println(s"value from channel: ${x}") }
Also it is possiblt to direclty read from future in case guard:
select.forever{ case x: T if (x==future.read) => Console.println(s"we receive value from future: ${x}") case x: T if (x==channel.read) => Console.println(s"value from channel: ${x}") }
ChannelActor - actor, which leave
Entity, from which we can read objects of type A.
Builder for 'input' selector.
Builder for 'input' selector. Can be obtained as gopherApi.select.input
.
or map of forever selector.
Wrap origin
input into input, which produce 'timeout' value into timeouts
channel
when reading from wrapped channel take more time than timeout
.
Wrap origin
input into input, which produce 'timeout' value into timeouts
channel
when reading from wrapped channel take more time than timeout
.
InputChannel.withInputTimeouts
lazy channel, which created during first input/output operations.
lazy channel, which created during first input/output operations. (used in transputers as default value for In/Out Ports)
Builder for 'once' selector.
Builder for 'once' selector. Can be obtained as gopherApi.select.once
.
channel, in which only one message can be written, after which it is automatically closed
channel, in which only one message can be written, after which it is automatically closed
Writer is not waiting for reader to start.
Input, which combine two other inputs.
Input, which combine two other inputs.
can be created with '|' operator.
val x = read(x|y)
Entity, where we can write objects of type A.
Factory for select instantiation.
Factory for select instantiation. Can be obtained via gopherAPI
val selector = gopherApi.select.forever for(s <- selector) ...
skip (i.e.
skip (i.e. do some operation not related to reading or writing.)
Actor backend for channel
this message is send, when all references to some instance of this channel are unreachable, so if we have no other instances (i.e.
this message is send, when all references to some instance of this channel are unreachable, so if we have no other instances (i.e. remote channel incarnation), than we must destroy channel.
this message is send, when we create new remote reference to channel, backed by this actor.
When we decide to stop channel, do it via special message, to process one after messages, which exists now in queue.
When we decide to stop channel, do it via special message, to process one after messages, which exists now in queue.
Note, that channel-stop messages can be send only from ChannelActor
never means the end of conversation
Overview
Internals
Core entity is Continuated which provide iteratee-like structure for reading and writing. Instance of Continuated represent one step of computations and leave in queue inside ChannelProcessor or ChannelActor Selector transform Continuated to executed exclusive with each other within one selector. Also we have IdleDetector which determinate idle selectors and activer appropriative actions.