Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@vonage/js-workerizer
Advanced tools
Library providing a simple way to run a class instance on its dedicated worker.
Library providing a simple way to run a class instance on its dedicated worker.
# Install dependencies
npm install @vonage/js-workerizer
# from the example/basic directory
npm install
npm run dev
import { MyWorkerizableClass } from "./my-workerizable-class.ts";
import Worker from "./my-workerizable-class.ts?worker&inline";
const onMainThread = new MyWorkerizableClass();
onMainThread.doSomething(); // run on the main thread
const onAWorker = await workerize(MyWorkerizableClass, Worker);
await onMainThread.doSomething(); // run on a worker
Imaging you want to run this class in a worker.
export class HugeProcessClass {
run() {
// ... super slow process
}
}
// Class usage
const process = new HugeProcessClass();
process.run(); // will run on the main thread
We suggest to call it in the static constructor of the class. Decorator should be provided soon as typescript release them.
export class HugeProcessClass {
// ... class impl
// These lines allow the class to be used in a worker
static {
registerWorker('HugeProcessClass', this);
}
}
// Class usage
const process = await workerize(HugeProcessClass);
await process.run(); // will run on a worker
export class SomeClass {
// this method will be call if defined before the worker is terminated
public terminate() {
}
// These lines allow the class to be used in a worker
static {
registerWorker('HugeProcessClass', this);
}
}
// Class usage
const worker = await workerize(SomeClass);
await worker.terminate();
This project is licensed under the terms of the MIT license and is available for free.
FAQs
Library providing a simple way to run a class instance on its dedicated worker.
We found that @vonage/js-workerizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 42 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.