Web 消息总线 JetBus

码农软件 · 软件分类 · ESB企业服务总线 · 2020-02-11 22:27:22

软件介绍

Jet 是一个用于 Web 的轻量级和实时的消息总线。支持浏览器和 Node.js node-jet,提供 Lua 版本 lua-jet 和基于 Arduino 的版本 Arduino-Jet

示例代码:

var jet = require('node-jet');

var peer = new jet.Peer({
  url: 'ws://jet.nodejitsu.com:80'
});

peer.connect().then(function() {
  console.log('peer is connected to daemon');
});

var machineName = new jet.State('machine/name', 'animal');
machineName.on('set', function(newName) {
  setMachineName(newName); // does something appropriate
});

peer.add(machineName).then(function() {
  console.log('machine/name has been added to daemon');
}).catch(function(err) {
  console.log('could not add machine/name to daemon', err);
});

// add a state
var cpuLoad = new jet.State('cpu/load', readCpuLoad());

peer.add(cpuLoad).then(function() {
  // async post new value
  setTimeout(function () {
    cpuLoad.value(readCpuLoad());
  },3000);
});

添加方法:

// add a method
var greet = new jet.Method('greet');
greet.on('call', function(name) {
    if (name.first === 'John') {
      throw 'John is a bad guy!';
    }
    var greeting = 'Hello ' + name.first + ' ' + name.last;
    console.log(greeting);
    return greeting;
});

peer.add(greet);


本文地址:https://www.codercto.com/soft/d/25414.html

鼠标宣言

鼠标宣言

约翰·里德尔 / 倪萍、梅清豪 / 上海人民 / 2005-08-01 / 25.00

本书针对信息时代营销者不知该如何满足消费者的营销困境,提出了崭新的解决方案——以新技术为基础的群体筛选和推荐系统。随着信息管理软件和internet的高速发展,群体筛选技术下的推荐系统通过大量有关消费者偏好和购物记录的信息,以及对产品特征的准确把握,能够为消费者进行精确的推荐,提高了消费者的购物效率和准确度以及营销者的营销效率和竞争力。本书通过通俗而到位的讲解,向读者全面介绍了有关群体筛选技术的理......一起来看看 《鼠标宣言》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具