plasmon-osx
v0.0.6
Published
message bus api for bridging clients communications into central bus.
Downloads
26
Readme
MessagingNode for osx
message bus api for bridging clients communications into central bus.
API doc
* node environment
node -v
v8.2.1* dependency of node.js/api: plasmon-osx
require("plasmon-osx")* npm basement
npm installapi usage
before formal usage
//require a kernal dependency
var fino = require("plasmon-osx/lib/Kernal")
//set Client from kernal as universe param
var Client = fino.Clientcreate a client
//client as an oms module instance
Client client = new Client("oms","1"); publish a topic messages supported by message bus protocols
//message from direct string
client.publish("heartbeat","8=PLASMON.1.09=635=HB10=042")subscribe a topic messages
//use callback function directlly handle message.it's automatically done in multi-thread and asyc with no block
//subscribe a message
client.subscribe("order","Account=mike",function (message) {
// handle message
console.log("sub message is :" + message)
})query a topic messages
//query a message
client.query("order","Account=mike",function (m) {
// handle message
console.log("query message is :" + m)
});query and subscribe a topic messages
//query & sub a message
client.queryAndSubscribe("order","Account=mike AND Symbol=IBM",function (m) {
console.log("querysub message is :" + m)
})cache-server is needed
nats environment is needed
redis environment is needed
feedback and report an issue
send at : [email protected]
