Package

gopher

channels

Permalink

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
Visibility
  1. Public
  2. All

Type Members

  1. class ActorBackedChannel[A] extends Channel[A]

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

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

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

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

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

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

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

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

    Permalink
  10. class BufferedChannelActor[A] extends ChannelActor[A]

    Permalink

    ChannelActor - actor, which leave

  11. trait Channel[A] extends InputOutput[A]

    Permalink
  12. abstract class ChannelActor[A] extends Actor

    Permalink

    ChannelActor - actor, which leave

  13. sealed trait ChannelActorMessage extends AnyRef

    Permalink
  14. case class ChannelCloseProcessed(nElements: Int) extends ChannelActorMessage with Product with Serializable

    Permalink

    result of CloseChannelRead, return number of elements left to read

  15. class ChannelProcessor extends Actor

    Permalink
  16. class ChannelSupervisor extends Actor

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

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

    Permalink

    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.

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

    Permalink

    read A and compute B as result.

  20. 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

    Permalink

    write A and compute B as result

  21. sealed trait Continuated[+A] extends AnyRef

    Permalink

    represent continuated computation from A to B.

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

    Permalink
  23. class DuppedInput[A] extends AnyRef

    Permalink
  24. trait EffectedChannel[A] extends Channel[A] with Effected[Channel[A]]

    Permalink
  25. trait EffectedInput[A] extends Input[A] with Effected[Input[A]]

    Permalink
  26. trait EffectedOutput[A] extends Effected[Output[A]] with Output[A]

    Permalink
  27. sealed trait FlowContinuated[A] extends Continuated[A]

    Permalink
  28. class FoldSelect[T] extends FoldSelectorBuilder[T]

    Permalink

    Short name for use in fold signature

  29. trait FoldSelectorBuilder[T] extends SelectorBuilder[T]

    Permalink
  30. class FoldSelectorBuilderImpl extends AnyRef

    Permalink
  31. trait ForeverSelectorBuilder extends SelectorBuilder[Unit]

    Permalink

    Builder for 'forever' selector.

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

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

    Permalink

    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}")
    }
  33. class IdleDetector extends AnyRef

    Permalink
  34. trait Input[A] extends AnyRef

    Permalink

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

  35. trait InputOutput[A] extends Input[A] with Output[A]

    Permalink
  36. class InputSelectorBuilder[T] extends SelectorBuilder[T] with Input[T]

    Permalink

    Builder for 'input' selector.

    Builder for 'input' selector. Can be obtained as gopherApi.select.input. or map of forever selector.

  37. class InputWithTimeouts[A] extends AnyRef

    Permalink

    Wrap origin input into input, which produce 'timeout' value into timeouts channel when reading from wrapped channel take more time than timeout .

    Wrap origin input into input, which produce 'timeout' value into timeouts channel when reading from wrapped channel take more time than timeout .

    See also

    InputChannel.withInputTimeouts

  38. class LazyChannel[A] extends Input[A] with Output[A]

    Permalink

    lazy channel, which created during first input/output operations.

    lazy channel, which created during first input/output operations. (used in transputers as default value for In/Out Ports)

  39. class MultithreadedEffectedChannel[A] extends MultithreadedEffected[Channel[A]] with EffectedChannel[A]

    Permalink
  40. class MultithreadedEffectedInput[A] extends MultithreadedEffected[Input[A]] with EffectedInput[A]

    Permalink
  41. class MultithreadedEffectedOutput[A] extends MultithreadedEffected[Output[A]] with EffectedOutput[A]

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

    Permalink
  43. trait OnceSelectorBuilder[T] extends SelectorBuilder[T]

    Permalink

    Builder for 'once' selector.

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

  44. class OneTimeChannel[T] extends Channel[T]

    Permalink

    channel, in which only one message can be written, after which it is automatically closed

    channel, in which only one message can be written, after which it is automatically closed

    Writer is not waiting for reader to start.

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

    Permalink

    Input, which combine two other inputs.

    Input, which combine two other inputs.

    can be created with '|' operator.

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

    Permalink

    Entity, where we can write objects of type A.

  47. class OutputWithTimeouts[A] extends AnyRef

    Permalink

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

    Permalink
  49. sealed trait ReadSelectorArgument[A, B] extends AnyRef

    Permalink
  50. class SelectFactory extends AnyRef

    Permalink

    Factory for select instantiation.

    Factory for select instantiation. Can be obtained via gopherAPI

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

    Permalink
  52. trait SelectorBuilder[A] extends AnyRef

    Permalink
  53. class SelectorBuilderImpl extends AnyRef

    Permalink
  54. class SinglethreadedEffectedChannel[A] extends SinglethreadedEffected[Channel[A]] with EffectedChannel[A]

    Permalink
  55. class SinglethreadedEffectedInput[A] extends SinglethreadedEffected[Input[A]] with EffectedInput[A]

    Permalink
  56. class SinglethreadedEffectedOutput[A] extends SinglethreadedEffected[Output[A]] with EffectedOutput[A]

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

    Permalink

    skip (i.e.

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

  58. sealed trait SkipSelectorArgument[A] extends AnyRef

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

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

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

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

    Permalink
  63. class UnbufferedChannelActor[A] extends ChannelActor[A]

    Permalink

    ChannelActor - actor, which leave

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

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

    Permalink

Value Members

  1. object Channel

    Permalink
  2. object ChannelClose extends ChannelActorMessage with Product with Serializable

    Permalink
  3. object ChannelRefDecrement extends ChannelActorMessage with Product with Serializable

    Permalink

    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.

  4. object ChannelRefIncrement extends ChannelActorMessage with Product with Serializable

    Permalink

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

  5. object ContRead extends Serializable

    Permalink
  6. object ContWrite extends Serializable

    Permalink
  7. object CurrentFlowTermination

    Permalink
  8. object EffectedChannel

    Permalink
  9. object EffectedInput

    Permalink
  10. object EffectedOutput

    Permalink
  11. object FoldSelectorBuilder

    Permalink
  12. object GracefullChannelStop extends ChannelActorMessage with Product with Serializable

    Permalink

    When we decide to stop channel, do it via special message, to process one after messages, which exists now in queue.

    When we decide to stop channel, do it via special message, to process one after messages, which exists now in queue.

    Note, that channel-stop messages can be send only from ChannelActor

  13. object Input

    Permalink
  14. object InputMacro

    Permalink
  15. object Never extends Continuated[Nothing] with Product with Serializable

    Permalink

    never means the end of conversation

  16. object OneTimeChannel

    Permalink
  17. object Output

    Permalink
  18. object PromiseFlowTermination

    Permalink
  19. object SelectorBuilder

    Permalink
  20. object ZippedInput

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped