provide syntax for running select loop as async operation.
provide syntax for running select loop as async operation.
val receiver = gopherApi.select.forever{ case x: channel.read => Console.println(s"received:$x") }
terminate current flow and leave a
as result of flow.
terminate current flow and leave a
as result of flow.
have no effect if flow is already completed.
terminate current flow with exception.
terminate current flow with exception. Mostly used internally.
provide syntax for running select loop inside go (or async) block example of usage:
provide syntax for running select loop inside go (or async) block example of usage:
go { ..... for(s <- gopherApi.select.forever) s match { case x: ch1.read => do something with x case q: chq.read => implicitly[FlowTermination[Unit]].doExit(()) case y: ch2.write if (y=expr) => do something with y case _ => do somethig when idle. }
Note, that you can use implicit instance of [FlowTermination[Unit]] to stop loop.
check - if flow is completed.
check - if flow is completed.