spiderlink
v2.0.4
Published
Simple, yet optimized application intercommunication within the same machine. Based on WS.
Downloads
54
Readme
Spiderlink
Based on WS (UWS compatible)
Install module:
$ npm install pm2 -g
$ pm2 install spiderlink
Then expose some function in app1:
var app = require('spiderlink')('namespace');
app.expose('myfunction', function(data, done) {
// some processing
return done({ success : true, my : data });
});
On app2 call remote function:
var app = require('spiderlink')('namespace');
app.call('myfunction', { some : 'data'}, function(data) {
// data = result
});
PUB/SUB
$ npm install spiderlink
var app = require('spiderlink')('namespace');
app.subscribe('channel1', (message) => {
console.log('message:', message)
})
app.publish('channel1', { some : 'data' });
Front-end
Use dist/spiderlink.min.js and use it via window.Spiderlink
License
Apache 2