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

    transputers implementations

    transputers implementations

    Definition Classes
    gopher
    See also

    gopher.transputers.TransputerSupervisor

    gopher.transputers.ReplicatedTransputer

  • package util
    Definition Classes
    gopher
p

gopher

goasync

package goasync

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. class AsyncIterable[A, CC[_] <: Iterable[_]] extends AnyRef
  2. class AsyncIterableI[T] extends AnyRef
  3. final class AsyncOption[T] extends AnyVal

Value Members

  1. object AsyncApply
  2. object AsyncWrapper
  3. object GoAsync

    async arround go.

    async arround go.

    Basicly go is

    1. translate await-like exressions inside inline functions to calls of appropriative async functions. (or show error if not found). x.foreach{ x => p; await(x); .. } become await( transform-defer( x.foreachAsync{ x => async(p; await(x); ..) }) ) (note, that channel.read macroses are expanded to await-s on this point)

    2. transform defer calls if defer statement is found inside go: asnyc{ p .. defer(x) .. } become (reallity is a little complext, here is just idea) { val d = new Defers(); async{ p .. d.defer(x) .. }.onComplete(d.tryProcess) }

Ungrouped