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

    gopher.GopherAPI

    gopher.channels.Channel

    gopher.channels.Input

    gopher.channels.Output

    gopher.channels.SelectorBuilder

    gopher.channels.SelectFactory

  • 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. Protected

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

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from SelectorBuilder[A]

Inherited from AnyRef

Inherited from Any

Ungrouped