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

tinypool

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinypool - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

19

dist/esm/index.js

@@ -175,3 +175,4 @@ "use strict";

import { fileURLToPath as fileURLToPath2 } from "url";
var __tinypool_worker_message__ = "true";
var __tinypool_worker_message__ = true;
var SIGKILL_TIMEOUT = 1e3;
var ProcessWorker = class {

@@ -185,2 +186,6 @@ constructor() {

__publicField(this, "channel");
__publicField(this, "waitForExit");
__publicField(this, "onUnexpectedExit", () => {
this.process.emit("error", new Error("Worker exited unexpectedly"));
});
}

@@ -191,5 +196,12 @@ initialize(options) {

this.threadId = this.process.pid;
this.process.on("exit", this.onUnexpectedExit);
this.waitForExit = new Promise((r) => this.process.on("exit", r));
}
async terminate() {
return this.process.kill();
this.process.off("exit", this.onUnexpectedExit);
const sigkillTimeout = setTimeout(() => this.process.kill("SIGKILL"), SIGKILL_TIMEOUT);
this.process.kill();
await this.waitForExit;
this.port?.close();
clearTimeout(sigkillTimeout);
}

@@ -223,2 +235,5 @@ setChannel(channel) {

return this.process.on(event, (data) => {
if (event === "error") {
return callback(data);
}
if (!data || !data.__tinypool_worker_message__) {

@@ -225,0 +240,0 @@ return this.channel?.postMessage(data);

2

package.json
{
"name": "tinypool",
"version": "0.8.0",
"version": "0.8.1",
"description": "A minimal and tiny Node.js Worker Thread Pool implementation, a fork of piscina, but with fewer features",

@@ -5,0 +5,0 @@ "type": "module",

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