synonym for read.
synonym for read.
async incarnation of fold.
async incarnation of fold. Fold return future, which successed when channel is closed.
Operations withing fold applyed on result on each other, starting with s0.
val fsum = ch.afold(0){ (s, n) => s+n }
Here in fsum will be future with value: sum of all elements in channel until one has been closed.
instance of gopher API
instance of gopher API
when the first channel is exhaused, read from second.
when the first channel is exhaused, read from second.
async version of read.
async version of read. Immediatly return future, which will contains result of read or failur with StreamClosedException in case of stream is closed.
return feature which contains sequence from first n
elements.
return feature which contains sequence from first n
elements.
apply f, when input will be ready and send result to API processor
Input without close event: i.e. reading from closeless channel after channel close will wait forever instead throwing CloseChannelException
duplicate input
duplicate input
fold opeations, available inside async bloc.
fold opeations, available inside async bloc.
go {
val sum = ch.fold(0){ (s,n) => s+n }
}
run f
each time when new object is arrived.
run f
each time when new object is arrived. Ended when input closes.
must be inside go/async/action block.
synonim for non-deteremenistics choice.
synonim for non-deteremenistics choice.
read object from channel.
read object from channel. Must be situated inside async/go/action block.
return pair of inputs (ready, timeouts)
, such that when you read from ready
you receive element from this
and if during reading you wait more than specified timeout
, than timeout message is appear in timeouts
return pair of inputs (ready, timeouts)
, such that when you read from ready
you receive element from this
and if during reading you wait more than specified timeout
, than timeout message is appear in timeouts
val (inReady, inTimeouts) = in withInputTimeouts (10 seconds)
select.forever {
case x: inReady.read => Console.println(s"received value ${value}")
case x: inTimeouts.read => Console.println(s"timeout occured")
}
return input merged with 'other'.
return input merged with 'other'. (i.e. non-determenistics choice)
Input, which combine two other inputs.
can be created with '|' operator.
val x = read(x|y)