Object/Class

io.reactors.protocol

Router

Related Docs: class Router | package protocol

Permalink

object Router extends Serializable

Contains types and factory functions for router protocols.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Router
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

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

    Permalink

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

Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

    Permalink

    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

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

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

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

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

    Permalink

    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

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

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

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

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

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

    Permalink

    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]]): Policy[T]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

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

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

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

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

    Permalink

    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 Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped