public interface Selector extends JsonSerializable
Connection selectors are used to route messages between multiple instances of a component. When a message is sent on an output stream, the stream's selector will select a connection or set of connections to which to copy the message.
Vertigo supports custom selector implementations. To implement a custom
selector, simply implement the Selector interface as any selector
implementation does.
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL
all is a selector that routes messages to all connections. |
static String |
CUSTOM
custom indicates a custom selector. |
static String |
FAIR
fair is a selector that selects connections based on lowest queue size. |
static String |
HASH
hash is a mod-hash based connection selector. |
static String |
RANDOM
random is a random connection selector. |
static String |
ROUND_ROBIN
round-robin is a round robin connection selector. |
| Modifier and Type | Method and Description |
|---|---|
<T extends Connection> |
select(Object message,
List<T> connections)
Selects a list of connections to which to send a message.
|
static final String ROUND_ROBIN
round-robin is a round robin connection selector.static final String RANDOM
random is a random connection selector.static final String HASH
hash is a mod-hash based connection selector.static final String FAIR
fair is a selector that selects connections based on lowest queue size.static final String ALL
all is a selector that routes messages to all connections.static final String CUSTOM
custom indicates a custom selector.<T extends Connection> List<T> select(Object message, List<T> connections)
message - The message being sent.targets - A list of connections from which to select.Copyright © 2013-2014. All Rights Reserved.