Runtime hooks engine
The following hooks can be used:
Message sending
onSend- passed an array ofSendEventobjects. The messages inside these objects are exactly what the node has passed tonode.send- meaning there could be duplicate references to the same message object.preRoute- passed aSendEventpreDeliver- passed aSendEvent. The local router has identified the node it is going to send to. At this point, the message has been cloned if needed.postDeliver- passed aSendEvent. The message has been dispatched to be delivered asynchronously (unless the sync delivery flag is set, in which case it would be continue as synchronous delivery)onReceive- passed aReceiveEventwhen a node is about to receive a messagepostReceive- passed aReceiveEventwhen the message has been given to the node'sinputhandler(s)onComplete- passed aCompleteEventwhen the node has completed with a message or logged an error
add(hookId, callback)
Register a handler to a named hook
Parameters:
| Name | Type | Description |
|---|---|---|
hookId |
String
|
the name of the hook to attach to |
callback |
function
|
the callback function for the hook |
remove(hookId)
Remove a handled from a named hook
Parameters:
| Name | Type | Description |
|---|---|---|
hookId |
String
|
the name of the hook event to remove - must be |