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 goasync
    Definition Classes
    gopher
  • AsyncApply
  • AsyncIterable
  • AsyncOption
  • AsyncWrapper
  • GoAsync
o

gopher.goasync

AsyncApply

object AsyncApply

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsyncApply
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def appendImplicitExecutionContext(c: Context)(paramList: Seq[scala.reflect.macros.blackbox.Context.Tree]): Seq[scala.reflect.macros.blackbox.Context.Tree]
  2. macro def apply1i[A, B, C](hof: Function[Function[A, B], C])(nf: Function[A, Future[B]], implicitParams: Any*): Future[C]
  3. def createAsyncParam[A, B](c: Context)(fp: scala.reflect.macros.blackbox.Context.Tree)(implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[A], arg1: scala.reflect.macros.blackbox.Context.WeakTypeTag[B]): (scala.reflect.macros.blackbox.Context.TermName, scala.reflect.macros.blackbox.Context.Tree)
  4. def genAsyncName(c: Context)(h: scala.reflect.macros.blackbox.Context.TermName, pos: scala.reflect.macros.blackbox.Context.Position): scala.reflect.macros.blackbox.Context.TermName
  5. def impl1[A, B, C](c: Context)(hof: scala.reflect.macros.blackbox.Context.Expr[Function[Function[A, B], C]])(nf: scala.reflect.macros.blackbox.Context.Expr[Function[A, Future[B]]])(implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[A], arg1: scala.reflect.macros.blackbox.Context.WeakTypeTag[B], arg2: scala.reflect.macros.blackbox.Context.WeakTypeTag[C]): scala.reflect.macros.blackbox.Context.Expr[Future[C]]
  6. def impl1i[A, B, C](c: Context)(hof: scala.reflect.macros.blackbox.Context.Expr[Function[Function[A, B], C]])(nf: scala.reflect.macros.blackbox.Context.Expr[Function[A, Future[B]]], implicitParams: scala.reflect.macros.blackbox.Context.Expr[Any]*)(implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[A], arg1: scala.reflect.macros.blackbox.Context.WeakTypeTag[B], arg2: scala.reflect.macros.blackbox.Context.WeakTypeTag[C]): scala.reflect.macros.blackbox.Context.Expr[Future[C]]
  7. def inferImplicitExecutionContext(c: Context)(): scala.reflect.macros.blackbox.Context.Tree
  8. def transformHof[A, B](c: Context)(hof: scala.reflect.macros.blackbox.Context.Tree, imps: Seq[scala.reflect.macros.blackbox.Context.Tree])(implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[A], arg1: scala.reflect.macros.blackbox.Context.WeakTypeTag[B]): scala.reflect.macros.blackbox.Context.Tree
  9. def transformLast(c: Context)(f: (scala.reflect.macros.blackbox.Context.Tree) ⇒ scala.reflect.macros.blackbox.Context.Tree)(block: List[scala.reflect.macros.blackbox.Context.Tree]): List[scala.reflect.macros.blackbox.Context.Tree]