final case class Exchange[I, W](read: Process[Task, I], write: Sink[Task, W]) extends Product with Serializable

Exchange represents interconnection between two systems. So called remote is resource from which program receives messages of type I and can send to it messages of type O.

Typically this can be sort of connection to external system, like for example tcp connection to internet server.

Exchange allows combining this pattern with Processes and allows to use different combinators to specify the Exchange behaviour.

Exchange is currently specialized to scalaz.concurrent.Task

I

values read from remote system

W

values written to remote system

read

Process reading values from remote system

write

Process writing values to remote system

Self Type
Exchange[I, W]
Source
Exchange.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Exchange
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Exchange(read: Process[Task, I], write: Sink[Task, W])

    read

    Process reading values from remote system

    write

    Process writing values to remote system

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to any2stringadd[Exchange[I, W]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Exchange[I, W], B)
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to ArrowAssoc[Exchange[I, W]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (Exchange[I, W]) ⇒ Boolean, msg: ⇒ Any): Exchange[I, W]
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (Exchange[I, W]) ⇒ Boolean): Exchange[I, W]
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): Exchange[I, W]
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): Exchange[I, W]
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def flow[I2, W2](y: WyeW[W, \/[Int, I], W2, I2])(implicit S: Strategy): Exchange[I2, W2]

    Transform this Exchange to another Exchange where queueing, flow control and transformation of this I and W is controlled by supplied WyeW.

    Transform this Exchange to another Exchange where queueing, flow control and transformation of this I and W is controlled by supplied WyeW.

    Note this allows for fine-grained flow-control of written W to server based on Int passed to left side of supplied WyeW that contains actual size of queued values to be written to server.

    y

    WyeW to control queueing, flow control and transformation

  15. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to StringFormat[Exchange[I, W]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def mapO[I2](f: (I) ⇒ I2): Exchange[I2, W]

    uses provided function f to be applied on any I received

  19. def mapW[W2](f: (W2) ⇒ W): Exchange[I, W2]

    applies provided function to any W2 that has to be written to provide an W

  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  23. def pipeBoth[I2, W2](r: Process1[I, I2], w: Process1[W2, W]): Exchange[I2, W2]

    Creates new exchange, that will pipe read values through supplied r and write values through w

    Creates new exchange, that will pipe read values through supplied r and write values through w

    r

    Process1 to use on all read values

    w

    Process1 to use on all written values

  24. def pipeO[I2](p1: Process1[I, I2]): Exchange[I2, W]

    Creates exchange that pipe read I values through supplied p1.

    Creates exchange that pipe read I values through supplied p1.

    p1

    Process1 to be used when reading values

  25. def pipeW[W2](p1: Process1[W2, W]): Exchange[I, W2]

    Creates new exchange, that pipes all values to be sent through supplied p1

  26. val read: Process[Task, I]

    Process reading values from remote system

  27. def readThrough[I2](w: Writer1[W, I, I2])(implicit S: Strategy): Exchange[I2, W]

    Transforms this exchange to another exchange, that for every received I will consult supplied Writer1 and eventually transforms I to I2 or to W that is sent to remote system.

    Transforms this exchange to another exchange, that for every received I will consult supplied Writer1 and eventually transforms I to I2 or to W that is sent to remote system.

    Please note that if external system is slow on reading W this can lead to excessive heap usage. If you want to avoid for this to happen, please use flow instead.

    w

    Writer that processes received I and either echoes I2 or writes W to external system

  28. def run(p: Process[Task, W] = halt, terminateOn: Request = Request.L)(implicit S: Strategy): Process[Task, I]

    Runs supplied Process of W values by sending them to remote system.

    Runs supplied Process of W values by sending them to remote system. Any replies from remote system are received as I values of the resulting process.

    Please note this will terminate by default after Left side (receive) terminates. If you want to terminate after Right side (W) terminates, supply terminateOn with Request.R or Request.Both to terminate on Right or Any side respectively

    p

    Process of W values to send

    terminateOn

    Terminate on Left side (receive), Right side (W) or Any side terminates

  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def through[I2](ch: Channel[Task, I, Process[Task, I2]]): Exchange[I2, W]

    Creates Exchange that runs read I through supplied effect channel.

    Creates Exchange that runs read I through supplied effect channel.

    ch

    Channel producing process of I2 for each I received

  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. val write: Sink[Task, W]

    Process writing values to remote system

  35. def wye[I2, W2](y: WyeW[W, I, W2, I2])(implicit S: Strategy): Exchange[I2, W2]

    Transform this Exchange to another Exchange where queueing, and transformation of this I and W is controlled by supplied WyeW.

    Transform this Exchange to another Exchange where queueing, and transformation of this I and W is controlled by supplied WyeW.

    Please note the W queue of values to be sent to server is unbounded any may cause excessive heap usage, if the remote system will read W too slow. If you want to control this flow, use rather flow.

    y

    WyeW to control queueing and transformation

  36. def [B](y: B): (Exchange[I, W], B)
    Implicit
    This member is added by an implicit conversion from Exchange[I, W] to ArrowAssoc[Exchange[I, W]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Exchange[I, W] to any2stringadd[Exchange[I, W]]

Inherited by implicit conversion StringFormat from Exchange[I, W] to StringFormat[Exchange[I, W]]

Inherited by implicit conversion Ensuring from Exchange[I, W] to Ensuring[Exchange[I, W]]

Inherited by implicit conversion ArrowAssoc from Exchange[I, W] to ArrowAssoc[Exchange[I, W]]

Ungrouped