Packages

  • package root
    Definition Classes
    root
  • package gopher

    Provides scala API for 'go-like' CSP channels.

    Provides scala API for 'go-like' CSP channels.

    Overview

    see readme for quick introduction.

    Usage

    At first you must receive gopherApi as Akka extension:

    import gopher._
    
    .....
    val gopherApi = Gopher(actorSystem)

    Then you can use CPS channels with blocling operations inside go clauses:

    val channel = gopherApi.makeChannel[Long]
    val n = 10000
    val producer = go {
     @volatile var(x,y) = (0L,1L)
     for( s <- gopherApi.select.forever) {
       case z: channel.write if (z==x) =>
                  x = y
                  y = x+z
                  if (x > n) {
                     channel.close
                     implicitly[FlowTermination[Unit]].doExit()
                  }
     }
    }
    val consumer = for((c,i) <- channel.zip(1 to n)) {
       Console.println(s"fib(${i})=${c}")
    }
    Await.ready(consumer, 10 seconds)

    and defer/recover in go/goScope

    goScope{
      val f = openFile(myFileName)
      defer{
        if (! recover{case ex:FileNotFoundException => Console.println("invalid fname")}) {
           f.close()
        }
      }
    }
    Definition Classes
    root
    See also

    channels.SelectFactory

    channels.SelectorBuilder

    channels.Output

    channels.Input

    channels.Channel

    GopherAPI

  • package channels

    Core entity is Continuated which provide iteratee-like structure for reading and writing.

    Overview

    • Input and Output provide callback-based interfaces for input/output facilities.
    • Channel provide implementation for asynchronics channels processing inside JVM.
    • SelectorBuilder is a way to create selectors.

    Internals

    Core entity is Continuated which provide iteratee-like structure for reading and writing. Instance of Continuated represent one step of computations and leave in queue inside ChannelProcessor or ChannelActor Selector transform Continuated to executed exclusive with each other within one selector. Also we have IdleDetector which determinate idle selectors and activer appropriative actions.

    Definition Classes
    gopher
  • class ECSelectFactory extends SelectFactory
    Definition Classes
    channels
  • EcProvider
  • SelectFactoryApi

trait EcProvider[A] extends SelectorBuilder[A]

Linear Supertypes
SelectorBuilder[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EcProvider
  2. SelectorBuilder
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type timeout = FiniteDuration
    Definition Classes
    SelectorBuilder

Abstract Value Members

  1. abstract def api: GopherAPI
    Definition Classes
    SelectorBuilder

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def ec: ExecutionContext
    Definition Classes
    EcProviderSelectorBuilder
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def futureInput[A](f: Future[A]): FutureInput[A]
    Definition Classes
    SelectorBuilder
    Annotations
    @inline()
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  12. final def go: Future[A]
    Definition Classes
    SelectorBuilder
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  18. def onError(arg: ErrorSelectorArgument[A]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
  19. def onIdle(arg: SkipSelectorArgument[A]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
  20. def onRead[E](ch: Input[E])(arg: ReadSelectorArgument[E, A]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
  21. def onTimeout(t: FiniteDuration)(arg: SkipSelectorArgument[A]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
  22. def onWrite[E](ch: Output[E])(arg: WriteSelectorArgument[E, A]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
  23. def selectorRun: Future[A]
    Definition Classes
    SelectorBuilder
  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. def withError(f: (ExecutionContext, FlowTermination[A], Continuated[A], Throwable) ⇒ Future[Continuated[A]]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
    Annotations
    @inline()
  30. def withIdle(f: (Skip[A]) ⇒ Option[Future[Continuated[A]]]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
    Annotations
    @inline()
  31. def withReader[B](ch: Input[B], f: (ContRead[B, A]) ⇒ Option[(In[B]) ⇒ Future[Continuated[A]]]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
    Annotations
    @inline()
  32. def withTimeout(t: FiniteDuration)(f: (Skip[A]) ⇒ Option[Future[Continuated[A]]]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
    Annotations
    @inline()
  33. def withWriter[B](ch: Output[B], f: (ContWrite[B, A]) ⇒ Option[(B, Future[Continuated[A]])]): EcProvider.this.type
    Definition Classes
    SelectorBuilder
    Annotations
    @inline()

Inherited from SelectorBuilder[A]

Inherited from AnyRef

Inherited from Any

Ungrouped