Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

antena

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antena - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

package.json
{
"name": "antena",
"description": "API to uniformely perform (a)synchronous http requests and websocket connections",
"version": "0.1.3",
"version": "0.1.4",
"author": {

@@ -6,0 +6,0 @@ "name": "Laurent Christophe",

@@ -7,3 +7,3 @@ # antena

While emitters should receive information to connect to a receptor at their creation.
Usage [here](/demo), live demo [here](https://cdn.rawgit.com/lachrist/antena/8e7431d1/demo/index.html).
Usage [here](/demo), live demo [here](https://cdn.rawgit.com/lachrist/antena/8964c4d2/demo/index.html).

@@ -62,7 +62,13 @@ ## `Handlers`

### `terminate = receptor.spawn(url)`
### `worker = receptor.spawn(url)`
* `receptor :: antena.ReceptorWorker`
* `url :: string | object-url`
* `terminate()`
* `worker :: EventTarget`
* `terminate()`
* BrowserEvent `error :: ErrorEvent`
* `message :: string`
* `filename :: string`
* `lineno :: number`
* `colno :: number`

@@ -69,0 +75,0 @@ ### `onrequest = receptor.handler("request")`

@@ -6,5 +6,15 @@

module.exports = function (url) {
function terminate () {
this.terminate();
for (var i=0; this._pool.get[i] !== void 0; i++) {
if (pool.get[i] !== null) {
this._pool.get[i].readyState = 3;
this._pool.get[i].emit("close", 1001, "CLOSE_GOING_AWAY")
}
};
}
module.exports = function (url, options) {
var self = this;
var worker = new Worker(url);
var worker = new Worker(url, options);
var pool = WebworkerSocketPool(worker);

@@ -59,23 +69,13 @@ var views = null;

};
worker.onmessage = function (message) {
worker.addEventListener("message", function (event) {
if (views)
return handlers[message.data.name](message.data);
return handlers[event.data.name](event.data);
views = {};
views.lock = new Uint8Array(message.data, 0, 1);
views.length = new Uint32Array(message.data, 4, 1);
views.data = new Uint16Array(message.data, 8);
};
return function () {
worker.terminate();
worker.onmessage = null;
for (var i=0; pool.get[i] !== void 0; i++) {
if (pool.get[i] !== null) {
pool.get[i].readyState = 3;
pool.get[i].emit("close", 1001, "CLOSE_GOING_AWAY")
}
};
pool = null;
views = null;
handlers = null;
};
views.lock = new Uint8Array(event.data, 0, 1);
views.length = new Uint32Array(event.data, 4, 1);
views.data = new Uint16Array(event.data, 8);
});
worker._pool = pool;
worker.terminate = terminate;
return worker;
};
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc