Packages

t

gopher

FlowTermination

trait FlowTermination[-A] extends AnyRef

FlowTermination[-A] - termination of flow.

Inside each block in select loop or select apply (once or forever) we have implicit FlowTermination entity, which we can use for exiting the loop.

select.forever{
    case x: info.read => Console.println(s"received from info $x")
    case x: control.read => implicitly[FlowTermination[Unit]].doExit(())
}
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FlowTermination
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def doExit(a: A): A

    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.

  2. abstract def doThrow(e: Throwable): Unit

    terminate current flow with exception.

    terminate current flow with exception. Mostly used internally.

  3. abstract def isCompleted: Boolean

    check - if flow is completed.

  4. abstract def throwIfNotCompleted(ex: Throwable): Unit