gopher

channels

package channels

Overview

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. channels
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class AsyncFullReadSelectorArgument[A, B](f: (ContRead[A, B]) ⇒ Option[(() ⇒ A) ⇒ Future[Continuated[B]]]) extends ReadSelectorArgument[A, B] with Product with Serializable

  2. case class AsyncFullSkipSelectorArgument[A](f: (Skip[A]) ⇒ Option[Future[Continuated[A]]]) extends SkipSelectorArgument[A] with Product with Serializable

  3. case class AsyncFullWriteSelectorArgument[A, B](f: (ContWrite[A, B]) ⇒ Option[(A, Future[Continuated[B]])]) extends WriteSelectorArgument[A, B] with Product with Serializable

  4. case class AsyncNoGenReadSelectorArgument[A, B](f: (ContRead[A, B]) ⇒ (A) ⇒ Future[Continuated[B]]) extends ReadSelectorArgument[A, B] with Product with Serializable

  5. case class AsyncNoOptSkipSelectorArgument[A](f: (Skip[A]) ⇒ Future[Continuated[A]]) extends SkipSelectorArgument[A] with Product with Serializable

  6. case class AsyncNoOptWriteSelectorArgument[A, B](f: (ContWrite[A, B]) ⇒ (A, Future[Continuated[B]])) extends WriteSelectorArgument[A, B] with Product with Serializable

  7. case class AsyncNoOptionReadSelectorArgument[A, B](f: (ContRead[A, B]) ⇒ (() ⇒ A) ⇒ Future[Continuated[B]]) extends ReadSelectorArgument[A, B] with Product with Serializable

  8. case class AsyncPairReadSelectorArgument[A, B](f: (A, ContRead[A, B]) ⇒ Future[Continuated[B]]) extends ReadSelectorArgument[A, B] with Product with Serializable

  9. class ChannelActor[A] extends Actor

  10. case class ChannelCloseProcessed(nElements: Integer) extends Product with Serializable

    result of CloseChannelRead, return number of elements left to read

  11. class ChannelProcessor extends Actor

  12. class ChannelSupervisor extends Actor

  13. case class CloseChannel(id: Long) extends Product with Serializable

  14. case class ClosedChannelRead(cont: ContRead[_, _]) extends Product with Serializable

    this is message wich send to ChannelActor, when we know, that channel is closed.

    this is message wich send to ChannelActor, when we know, that channel is closed. In such case, we don't konw: is actor stopped or not, So, we say this message (instead read) and wait for reply. If reply is not received within given timeout: think that channel is-dead.

  15. case class ContRead[A, B](function: (ContRead[A, B]) ⇒ Option[(() ⇒ A) ⇒ Future[Continuated[B]]], channel: Input[A], flowTermination: FlowTermination[B]) extends FlowContinuated[B] with Product with Serializable

    read A and compute B as result.

  16. case class ContWrite[A, B](function: (ContWrite[A, B]) ⇒ Option[(A, Future[Continuated[B]])], channel: Output[A], flowTermination: FlowTermination[B]) extends FlowContinuated[B] with Product with Serializable

    write A and compute B as result

  17. sealed trait Continuated[+A] extends AnyRef

    represent continuated computation from A to B.

  18. case class Done[A](result: A, flowTermination: FlowTermination[A]) extends FlowContinuated[A] with Product with Serializable

  19. sealed trait FlowContinuated[A] extends Continuated[A]

  20. class ForeverSelectorBuilder extends SelectorBuilder[Unit]

    Builder for 'forever' selector.

    Builder for 'forever' selector. Can be obtained as gopherApi.select.forever.

  21. class FutureInput[A] extends Input[A]

    Future[A], represented as input which produce a value when completed, after this closes.

    Future[A], represented as input which produce a value when completed, after this closes. If evaluation of feature is unsuccessful (i.e. failure), than appropriative exception is thrown during reading.

    Can be obtained from gopherApi.

    import gopherApi._
    
    val myInput = futureInput(future)
    select.forever{
       case x: myInput.read => Console.println(s"we receive value from future: ${x}")
                             implicitly[FlowTermination[Unit]].doExit(())
       case x: myChannel.read => Console.println(s"value from channel: ${x}")
    }

    Also it is possiblt to direclty read from future in case guard:

    select.forever{
    case x: T if (x==future.read) => Console.println(s"we receive value from future: ${x}")
    case x: T if (x==channel.read) => Console.println(s"value from channel: ${x}")
    }
  22. class IOChannel[A] extends Input[A] with Output[A]

  23. class IdleDetector extends AnyRef

  24. trait Input[A] extends AnyRef

    Entity, from which we can read objects of type A.

  25. case class NewChannel(id: Long, capacity: Int) extends Product with Serializable

  26. class OnceSelectorBuilder[T] extends SelectorBuilder[T]

    Builder for 'once' selector.

    Builder for 'once' selector. Can be obtained as gopherApi.select.once.

  27. class OrInput[A] extends Input[A]

    Input, which combine two other inputs.

    Input, which combine two other inputs.

    can be created with '|' operator.

    val x = read(x|y)
  28. trait Output[A] extends AnyRef

    Entity, where we can write objects of type A.

  29. trait PromiseFlowTermination[A] extends FlowTermination[A]

  30. sealed trait ReadSelectorArgument[A, B] extends AnyRef

  31. class SelectFactory extends AnyRef

    Factory for select instantiation.

    Factory for select instantiation. Can be obtained via gopherAPI

    val selector = gopherApi.select.forever
    for(s <- selector) ...
  32. class Selector[A] extends PromiseFlowTermination[A]

  33. class SelectorBuilder[A] extends AnyRef

  34. case class Skip[A](function: (Skip[A]) ⇒ Option[Future[Continuated[A]]], flowTermination: FlowTermination[A]) extends FlowContinuated[A] with Product with Serializable

    skip (i.e.

    skip (i.e. do some operation not related to reading or writing.)

  35. sealed trait SkipSelectorArgument[A] extends AnyRef

  36. case class SyncPairReadSelectorArgument[A, B](f: (A, ContRead[A, B]) ⇒ Continuated[B]) extends ReadSelectorArgument[A, B] with Product with Serializable

  37. case class SyncReadSelectorArgument[A, B](f: (ContRead[A, B]) ⇒ (() ⇒ A) ⇒ Continuated[B]) extends ReadSelectorArgument[A, B] with Product with Serializable

  38. case class SyncSelectorArgument[A](f: (Skip[A]) ⇒ Continuated[A]) extends SkipSelectorArgument[A] with Product with Serializable

  39. case class SyncWriteSelectorArgument[A, B](f: (ContWrite[A, B]) ⇒ (A, Continuated[B])) extends WriteSelectorArgument[A, B] with Product with Serializable

  40. sealed trait WriteSelectorArgument[A, B] extends AnyRef

  41. class ZippedInput[A, B] extends Input[(A, B)]

Value Members

  1. object ChannelClose extends Product with Serializable

  2. object ChannelRefDecrement extends Product with Serializable

    this message is send, when all references to some instance of this channel are unreachable, so if we have no other instances (i.e.

    this message is send, when all references to some instance of this channel are unreachable, so if we have no other instances (i.e. remote channel incarnation), than we must destroy channel.

  3. object ChannelRefIncrement extends Product with Serializable

    this message is send, when we create new remote reference to channel, backed by this actor.

  4. object ContRead extends Serializable

  5. object CurrentFlowTermination

  6. object Input

  7. object InputMacro

  8. object Never extends Continuated[Nothing] with Product with Serializable

    never means the end of conversation

  9. object Output

  10. object PromiseFlowTermination

  11. object SelectorBuilder

  12. object ZippedInput

Inherited from AnyRef

Inherited from Any

Ungrouped