node-red-contrib-mp-function 1.0.5

Multi-threaded function node for NODE-RED

npm install node-red-contrib-mp-function

Install


$ npm i node-red-contrib-mp-function

Or globally alongside Node-RED:


sudo npm i -g node-red-contrib-mp-function

You will need to restart Node-RED for it to pick-up the new nodes.

Changes in 1.0.5

new Change from round-robin message distribution to load-balanced. When all threads are loaded incoming messages are queued. When thread calculation is finished, node will check inner message queue for new tasks. fix Fix vm context failure on creation of new script setup.

Usage

node-red-contrib-mp-function is based on original IBM function node. You need to see it basic usage at first. This node allows you to run your hardcore calculation code in separate process (or some of them) without freezing of node-red process and your other precious flows.

Customization

As you can import some external npm modules from node-red configuration? you can provide them into this node in 'Requires' field. The string must contain a name prefered for usage in your code and module name (or path to it) connected by an '<-' and joined by colon. For example:

canvas<-canvas,mylovelymodule<-/path/to/mylovelymodule.js,gzip<-zlib

The imported modules are accessible via context.global.yourmodulename for compatibility with original module

Limitations

You can not use context, flow or global variables... yet. Write necessary info to the msg var before passing it into node. Event handlers on node variable also do not work. And probably wont.

But you can print messages with node.log, node.warn and node.error. And you can use statuses as well.

License

MIT License

Node Info

Version: 1.0.5
Updated 8 months, 2 weeks ago
License: MIT

Downloads

1 in the last day
12 in the last week
53 in the last month

Nodes

  • mp-function

Keywords

  • node-red

Maintainers

  • maxboar