MessageRouter is used to register and manage a list of handler objects for messages, and then to route messages to those handlers as messages arrive. MessageRouter also "knows" about the meaning of AMPS acks and can use them to automatically clean up routes as acks arrive.
More...
|
void | addRoute (CommandId commandId_, MessageHandler messageHandler_, Message.AckTypes requestedAcks_, Message.AckTypes systemAcks_, bool isSubscribe_) |
| Adds a route to self (MessageRouter). More...
|
|
void | addRouteSuspended (CommandId commandId_, MessageHandler messageHandler_, Message.AckTypes requestedAcks_, Message.AckTypes systemAcks_, bool isSubscribe_) |
| Adds a route to self (MessageRouter) in a suspended state for later activation. More...
|
|
bool | activateRoute (CommandId commandId_) |
| Activate a route from suspended state. More...
|
|
bool | removeRoute (CommandId commandId_) |
| Remove a route from MessageRouter. More...
|
|
bool | hasRoute (CommandId commandId_) |
| Return whether or not a command id has a route. More...
|
|
MessageHandler | findRoute (CommandId commandId_) |
| Find and return a route. More...
|
|
void | clear () |
| Removes all routes from self (MessageRouter). More...
|
|
void | clearSuspended () |
| Removes all suspended routes from self (MessageRouter). More...
|
|
void | unsubscribeAll () |
| Removes all subscriptions. More...
|
|
int | deliverAck (Message ackMessage_, Message.AckTypes ackType_) |
| Deliver a message that is known already to be an Ack. Coordinates the removal of routes based on the ack received and the original message type. More...
|
|
int | deliverData (Message dataMessage_) |
| Delivers a data message (not an Ack) to the registered route. Uses the commandID, subID, and queryID to deliver find a route and deliver to the first one found. This method is optimized for speed and does not attempt to examine ack types for removal of routes. More...
|
|
int | deliverData (Message dataMessage_, CommandId commandId_) |
| Delivers a data message(not an Ack) using a specific command ID from the message. Optimized for speed and does not attempt to examine the message for auto-removal of routes More...
|
|
MessageRouter is used to register and manage a list of handler objects for messages, and then to route messages to those handlers as messages arrive. MessageRouter also "knows" about the meaning of AMPS acks and can use them to automatically clean up routes as acks arrive.
◆ activateRoute()
bool AMPS.Client.MessageRouter.activateRoute |
( |
CommandId |
commandId_ | ) |
|
|
inline |
Activate a route from suspended state.
- Parameters
-
commandId_ | The command id for this route. |
- Returns
- Whether or not the route was activated.
◆ addRoute()
Adds a route to self (MessageRouter).
- Parameters
-
commandId_ | The command, query, or subid used for this route. |
messageHandler_ | The message handler to route to. |
requestedAcks_ | The acks requested by the AMPS client infrastructure. |
systemAcks_ | The acks requested by AMPS client infrastructure.
These will not be delivered to the message handler, but are still processed for auto-removal. |
isSubscribe_ | True if this route is for an ongoing subscription. |
◆ addRouteSuspended()
Adds a route to self (MessageRouter) in a suspended state for later activation.
- Parameters
-
commandId_ | The command, query, or subid used for this route. |
messageHandler_ | The message handler to route to. |
requestedAcks_ | The acks requested by the AMPS client infrastructure. |
systemAcks_ | The acks requested by AMPS client infrastructure.
These will not be delivered to the message handler, but are still processed for auto-removal. |
isSubscribe_ | True if this route is for an ongoing subscription. |
◆ clear()
void AMPS.Client.MessageRouter.clear |
( |
| ) |
|
|
inline |
◆ clearSuspended()
void AMPS.Client.MessageRouter.clearSuspended |
( |
| ) |
|
|
inline |
◆ deliverAck()
Deliver a message that is known already to be an Ack. Coordinates the removal of routes based on the ack received and the original message type.
- Parameters
-
ackMessage_ | The Message to deliver. |
ackType_ | The ack type from that message. |
- Returns
- The number of message deliveries that occurred.
◆ deliverData() [1/2]
int AMPS.Client.MessageRouter.deliverData |
( |
Message |
dataMessage_ | ) |
|
|
inline |
Delivers a data message (not an Ack) to the registered route. Uses the commandID, subID, and queryID to deliver find a route and deliver to the first one found. This method is optimized for speed and does not attempt to examine ack types for removal of routes.
- Parameters
-
dataMessage_ | The non-ack message to deliver. |
- Returns
- The number of deliveries performed.
◆ deliverData() [2/2]
int AMPS.Client.MessageRouter.deliverData |
( |
Message |
dataMessage_, |
|
|
CommandId |
commandId_ |
|
) |
| |
|
inline |
Delivers a data message(not an Ack) using a specific command ID from the message. Optimized for speed and does not attempt to examine the message for auto-removal of routes
- Parameters
-
dataMessage_ | The message to deliver. |
commandId_ | The command ID which will be used to lookup the delivery route. |
- Returns
- The number of deliveries performed.
◆ findRoute()
Find and return a route.
- Parameters
-
commandId_ | The command id for this route. |
- Returns
- The MessageHandler registered for this route, or null if none is registered.
◆ hasRoute()
bool AMPS.Client.MessageRouter.hasRoute |
( |
CommandId |
commandId_ | ) |
|
|
inline |
Return whether or not a command id has a route.
- Parameters
-
commandId_ | The command id for this route. |
- Returns
- Whether or not the route exists.
◆ removeRoute()
bool AMPS.Client.MessageRouter.removeRoute |
( |
CommandId |
commandId_ | ) |
|
|
inline |
Remove a route from MessageRouter.
- Parameters
-
commandId_ | The route to remove. |
- Returns
- True if the route was removed.
◆ unsubscribeAll()
void AMPS.Client.MessageRouter.unsubscribeAll |
( |
| ) |
|
|
inline |
Removes all subscriptions.
The documentation for this class was generated from the following file:
- AMPS.Client/MessageRouter.cs