shortcut for blocking write.
shortcut for blocking write.
shortcut for blocking write.
shortcut for blocking write.
synonym for read.
synonym for read.
instance of gopher API
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
apply f and send result to channels processor.
duplicate input
duplicate input
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.
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 if (x==somethingToWrite) =>
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)