scalaz.stream

Exchange

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 any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (Exchange[I, W], B)

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to ArrowAssoc[Exchange[I, W]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def ensuring(cond: (Exchange[I, W]) ⇒ Boolean, msg: ⇒ Any): Exchange[I, W]

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (Exchange[I, W]) ⇒ Boolean): Exchange[I, W]

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: ⇒ Any): Exchange[I, W]

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): Exchange[I, W]

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. 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

  17. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def mapO[I2](f: (I) ⇒ I2): Exchange[I2, W]

    uses provided function f to be applied on any I received

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

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

  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. 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

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

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

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

  28. val read: Process[Task, I]

    Process reading values from remote system

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

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

  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. 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

  33. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. val write: Sink[Task, W]

    Process writing values to remote system

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

  38. def [B](y: B): (Exchange[I, W], B)

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to ArrowAssoc[Exchange[I, W]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (exchange: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (exchange: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: Exchange[I, W]

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to ArrowAssoc[Exchange[I, W]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (exchange: ArrowAssoc[Exchange[I, W]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: Exchange[I, W]

    Implicit information
    This member is added by an implicit conversion from Exchange[I, W] to Ensuring[Exchange[I, W]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (exchange: Ensuring[Exchange[I, W]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

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 StringAdd

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

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

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

Ungrouped