Socket
Socket
Sign inDemoInstall

@akiroz/thalamus

Package Overview
Dependencies
51
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

16

dist/thalamus.js

@@ -161,3 +161,9 @@ "use strict";

this.ee.addListener(topic, handler);
return [4 /*yield*/, Promise.all(this.servers.map(function (serv) { return serv.subscribe(topic); }))];
return [4 /*yield*/, Promise.all(this.servers.map(function (serv) {
return serv.subscribe(topic)["catch"](function (err) {
if (!serv.connected)
return null; // Ignore fail due to disconnect
return Promise.reject(err);
});
}))];
case 1:

@@ -181,3 +187,9 @@ _a.sent();

}
return [4 /*yield*/, Promise.all(this.servers.map(function (serv) { return serv.unsubscribe(topic); }))];
return [4 /*yield*/, Promise.all(this.servers.map(function (serv) {
return serv.unsubscribe(topic)["catch"](function (err) {
if (!serv.connected)
return null; // Ignore fail due to disconnect
return Promise.reject(err);
});
}))];
case 1:

@@ -184,0 +196,0 @@ _a.sent();

2

package.json
{
"name": "@akiroz/thalamus",
"version": "0.0.4",
"version": "0.0.5",
"repository": "github:akiroz/Thalamus",

@@ -5,0 +5,0 @@ "main": "dist/thalamus.js",

@@ -22,7 +22,17 @@ # Thalamus

- `constructor(serverOptList: MQTT.IClientOptions[])`
- `async publish(topic: string, payload: Uint8Array)`
- `async subscribe(topic: string, handler: SubHandler)`
- `async unsubscribe(topic: string, handler?: SubHandler)`
- `async call(topic: string, params: Param = {}, opt = defaultOptions): Promise<Result>`
- `async register(topic: string, handler: (param, topic) => Result)`
- `constructor(serverOptList: MQTT.IClientOptions[])`
- `thalamus.servers` List of MQTT client objects
- `async publish(topic: string, payload: Uint8Array)`
- `async subscribe(topic: string, handler: SubHandler)`
- `async unsubscribe(topic: string, handler?: SubHandler)`
- `async call(topic: string, params: Param = {}, opt = defaultOptions): Promise<Result>`
- `async register(topic: string, handler: (param, topic) => Result)`
- `thalamus.ee.setMaxListeners(n)` Set maximum listeners for `subscribe` & `register`
- `thalamus.on("connect", (i) => {})` server `i` connected (i = 0-based index)
- `thalamus.on("close", (i) => {})` server `i` disconnected (i = 0-based index)
- `thalamus.on("error", (err, i) => {})` server `i` error (i = 0-based index)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc