-
Notifications
You must be signed in to change notification settings - Fork 2
Node class

Node constructor
-options: [any] - optional, any information you want to pass to node instance
-eventemitter: [Eventemitter] - optional, if you want the node to share a single event emitter use this parameter
Push a signal to the node.
-signal: [any] - the signal you want to push to node
-return: current node
Handle received signal. Usually you don't need to override this method, the default implementation delegates the signal handling to three methods:
- onSignal(signal) : handles the signal
- onError(error) : handles the error
- onEnd(signal) : handles the end
-signal: [any] - the signal to handle
-return: current node
Send a signal to the downstream nodes
-signal : the signal to send
-return: current node
Handle received signal. Override this method to implement your operator
-signal: [any] - the signal to handle
-return: current node
Handle errors.
Note: the argument may not be an Error object. You can override throwError(error) method to throw any object to represent an error. This is very useful if your system have a customised error structure.
-error: [any] - the object that represented an error. See throwError(error)
-return: current node
Handle END signal.
-signal: [any] - the END signal to handle
-return: current node
Check if an signal represents an error
-signal: [any] - the signal to check
-return: true if it represents an error otherwise false
Check if an signal represents an END of stream
-signal: [any] - the signal to check
-return: true if it represents an END otherwise false
Request a signal to the upstream node by sending a command.
-cmd: [any] - the cmd in your request
-return: current node
Handle received request from downstream nodes. For most operator, you don't need to override this method, by default it calls request() method to pass the request to upstream.
-cmd: [any] - the command to handle
-return: current node
Make a request to upstream
-cmd : the cmd to request
-return: current node