apply f, when input will be ready and send result to API processor
apply f, when input will be ready and send result to API processor
apply f and send result to channels processor.
apply f and send result to channels processor.
shortcut for blocking write.
shortcut for blocking write.
shortcut for blocking write.
shortcut for blocking write.
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.
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.
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.
alias for premap
alias for premap
before passing value to output, apply g to one.
before passing value to output, apply g to one.
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")
}
provide pair from Output and Input (ready, timeouts)
such that writing to ready
will case writing to output
and if it was not completed during
timeoutstimeout
than
appropriative duration will be availabe in input.
provide pair from Output and Input (ready, timeouts)
such that writing to ready
will case writing to output
and if it was not completed during
timeoutstimeout
than
appropriative duration will be availabe in input.
val (chReady, chTimeouts) = ch withOutputTimeouts (5 seconds)
select.forever {
case x: chReady.write if (x==somethingToWrite) =>
Console.println(s" ${x} send")
case t: chTimeouts.read =>
Console.println(s"timeout during writing")
}
'blocking' write of 'a' to channel.
'blocking' write of 'a' to channel. Note, that this method can be called only inside 'go' or 'async' blocks.
return input merged with 'other'.
return input merged with 'other'. (i.e. non-determenistics choice)