gopher.channels

SelectorContext

class SelectorContext extends Activable

context, which await of doing one of blocked operations. We can look on one as on implementation of go select statement: we can add to context pairs of inputs and outputs, and then when some of inputs and outputs are non-blockde, than action is performed. I.e. next block of 'go' select:

for(;;) {
 select match
   case x <- a => f1(x)
   case x <- b => f2(x)
   case 1 -> c => f3
   case _  => f4
}
is mapped do
 slc = new SelectorContext()
 slc.addInputAction(a, x=>f1(x))
 slc.addInputAction(b, x=>f2(x))
 slc.addOutputAction(c, {f4; Some(1) }
 slc.addIddleAction(f4)
 slc.run()
(and with help of macroses, can be write as
 selector match {
   case x <- a => f1(x)
   case x <- b => f2(x)
   case 1 -> c => f3
    case _ => f4
 }

Linear Supertypes
Activable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SelectorContext
  2. Activable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SelectorContext()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def activate(): Unit

    Definition Classes
    SelectorContextActivable
  7. def addInputAction[A](channel: InputChannel[A], action: (A) ⇒ Boolean): Unit

    called before selector context become running.

  8. def addOutputAction[A](channel: OutputChannel[A], action: () ⇒ Option[A]): Unit

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def go(implicit ex: ExecutionContext): Future[Unit]

    enable listeners and outputChannels

  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def run: Unit

  22. def runOnce(): Unit

    wait for 1-st event

  23. def setIddleAction(action: (Unit) ⇒ Unit): Unit

  24. def shutdown(): Unit

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Activable

Inherited from AnyRef

Inherited from Any

Ungrouped