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

@matrixai/workers

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matrixai/workers - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

6

dist/WorkerManager.d.ts

@@ -17,2 +17,4 @@ import type { ModuleThread } from 'threads';

* the function expression is defined
* If `cores` is set to 0, this creates a useless worker pool
* Use `undefined` to mean using all cores
*/

@@ -35,3 +37,5 @@ static createWorkerManager<W extends ModuleMethods>({ workerFactory, cores, logger, }: {

get destroyed(): boolean;
destroy(): Promise<void>;
destroy({ force, }?: {
force?: boolean;
}): Promise<void>;
call<T>(f: (worker: ModuleThread<W>) => Promise<T>): Promise<T>;

@@ -38,0 +42,0 @@ queue<T>(f: (worker: ModuleThread<W>) => Promise<T>): QueuedTask<ModuleThread<W>, T>;

6

dist/WorkerManager.js

@@ -45,2 +45,4 @@ "use strict";

* the function expression is defined
* If `cores` is set to 0, this creates a useless worker pool
* Use `undefined` to mean using all cores
*/

@@ -61,3 +63,3 @@ static async createWorkerManager({ workerFactory, cores, logger = new logger_1.default(this.name), }) {

}
async destroy() {
async destroy({ force = false, } = {}) {
if (this._destroyed) {

@@ -67,3 +69,3 @@ return;

this.logger.info('Destroying WorkerManager');
await this.pool.terminate();
await this.pool.terminate(force);
this._running = false;

@@ -70,0 +72,0 @@ this._destroyed = true;

{
"name": "@matrixai/workers",
"version": "1.2.3",
"version": "1.2.4",
"author": "Roger Qiu",

@@ -14,3 +14,3 @@ "description": "Multithreaded Workers",

"scripts": {
"build": "tsc -p ./tsconfig.build.json",
"build": "rm -r ./dist || true; tsc -p ./tsconfig.build.json",
"ts-node": "ts-node -r tsconfig-paths/register",

@@ -20,7 +20,7 @@ "test": "jest",

"lintfix": "eslint '{src,tests,benches}/**/*.{js,ts}' --fix",
"docs": "typedoc --tsconfig ./tsconfig.build.json --out ./docs src && touch ./docs/.nojekyll",
"docs": "rm -r ./docs || true; typedoc --gitRevision master --tsconfig ./tsconfig.build.json --out ./docs src && touch ./docs/.nojekyll",
"bench": "ts-node -r tsconfig-paths/register ./benches"
},
"dependencies": {
"@matrixai/logger": "^2.0.1",
"@matrixai/logger": "^2.1.0",
"threads": "^1.6.5",

@@ -27,0 +27,0 @@ "ts-custom-error": "^3.2.0"

Sorry, the diff of this file is not supported yet

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