io.reactors.protocol

Router

object Router

Contains types and factory functions for router protocols.

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

Type Members

  1. type Selector[T] = (T) ⇒ Channel[T]

    Type of a function that selects a channel given an event.

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def deficitRoundRobin[T](targets: Seq[Channel[T]], quantum: Int, cost: (T) ⇒ Int): Selector[T]

    Picks the next channel according to the Deficit Round Robin routing algorithm.

    Picks the next channel according to the Deficit Round Robin routing algorithm.

    This routing policy attempts to send the message to the channel that has so far received the least total cost, according to some cost function cost. The cost of an event could be its size (if the network transmission is the main concern), or the estimate on the processing time of that event (if computing bandwidth is the main concern).

    Each target channel has an associated deficit counter, which is increased by an amount called a quantum each time a channel gets selected, and decreased every time that an event is sent to it. When an event with a cost higher than the deficit counter appears, the next channel is selected.

    Note: quantum and cost should be relatively close in magnitude.

    T

    type of routed events

    targets

    sequence of target channels

    quantum

    the base cost quantum used to increase

    cost

    function from an event to its cost

    returns

    a selector

  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  11. def hash[T](targets: Seq[Channel[T]], hashing: (T) ⇒ Int = (x: T) => x.##): Selector[T]

    Consistently picks a channel using a hashing function on the event.

    Consistently picks a channel using a hashing function on the event.

    The hashing function is applied to the event, and the hash code is used to select a channel. Given that the same hash code is always returned for the same event, the same channel is always picked. This is useful when implementing, e.g. distributed hash tables.

    T

    type of the events routed

    targets

    target channels to which events are routed

    hashing

    hashing function from an event to some hash value

    returns

    the selector function

  12. def hashCode(): Int

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

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  17. def random[T](targets: Seq[Channel[T]], randfun: (Int) ⇒ Int = ...): Selector[T]

    Picks a channel from a random distribution.

    Picks a channel from a random distribution.

    T

    type of the events routed

    targets

    target channels to which to route the events

    randfun

    randomization function, total number of channels to an index

    returns

    the selector function

  18. def roundRobin[T](targets: Seq[Channel[T]]): Selector[T]

    Picks channels in a Round Robin manner.

    Picks channels in a Round Robin manner.

    T

    type of the events to route

    targets

    the channels to route the events to

    returns

    a selector function that chooses a channel

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

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def zeroSelector[T]: Selector[T]

    Always returns a zero channel, which loses all the events sent to it.

    Always returns a zero channel, which loses all the events sent to it.

    T

    type of the events to route

    returns

    a selector function that drops events

Inherited from AnyRef

Inherited from Any

Ungrouped