The previous fix to not clone the req/res objects introduced a bug where the req/res objects were lost from all but the first clone made out of a particular node.
Part of #85
A function that returns the same message to multiple outputs, where each output is wired to at most one node was not having its messages cloned due to the change I made in #85 to be slightly more efficient. By returning the same message to each output, cross pollution was possible.
Fixes#85
As well as adding deep-clone (via the new dependency on the 'clone' module), we no longer clone the message if there is a single recipient. This makes simple node-to-node flows more efficient.
I've done some simple profiling using process.hrtime to time how long the Node.send function takes, and at best, this change is neutral to performance.
The code scans the flows that are to be started and checks all
of the necessary node types are registered; if not, it doesn't
start the flows.
An event is emitted when each node type is registered - allowing
the server to track when all of the 'missing' node types register
and then start the flows.
This is a step towards adding node-types without restarting.