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.
type of routed events
sequence of target channels
the base cost quantum used to increase
function from an event to its cost
a selector
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.
type of the events routed
target channels to which events are routed
hashing function from an event to some hash value
the selector function
Picks a channel from a random distribution.
Picks a channel from a random distribution.
type of the events routed
target channels to which to route the events
randomization function, total number of channels to an index
the selector function
Picks channels in a Round Robin manner.
Picks channels in a Round Robin manner.
type of the events to route
the channels to route the events to
a selector function that chooses a channel
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.
type of the events to route
a selector function that drops events
Contains types and factory functions for router protocols.