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
c

gopher.goasync

AsyncOption

final class AsyncOption[T] extends AnyVal

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

Instance Constructors

  1. new AsyncOption(x: Option[T])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def filterAsync(f: (T) ⇒ Future[Boolean])(implicit ec: ExecutionContext): Future[Option[T]]
  6. def filterNotAsync(f: (T) ⇒ Future[Boolean])(implicit ec: ExecutionContext): Future[Option[T]]
  7. def flatMapAsync[U](f: (T) ⇒ Future[Option[U]])(implicit ec: ExecutionContext): Future[Option[U]]
  8. def foreachAsync[U](f: (T) ⇒ Future[U])(implicit ec: ExecutionContext): Future[Unit]
  9. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def mapAsync[U](f: (T) ⇒ Future[U])(implicit ec: ExecutionContext): Future[Option[U]]
  12. def toString(): String
    Definition Classes
    Any
  13. val x: Option[T]

Inherited from AnyVal

Inherited from Any

Ungrouped