@threadizer/core

1.0.0 • Public • Published

npm

Image

Threadizer

Run code within a worker (or main-thread as fallback).

The package is published on npm, sources and documentation are available on github.

Quick start

import Threadizer from "@threadizer/core";

// ...

const thread = new Threadizer(( thread )=>{

	console.log("Worker initialized", thread);

	thread.on("any-event", ({ detail: data, complete })=>{

		console.log("Processing data", data);

		//...

		complete(data);

	});

});

const results = await thread.transfer("any-event", someData);

More examples are available on the demo page and the full documentation is in the wiki

/@threadizer/core/

    Package Sidebar

    Install

    npm i @threadizer/core

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    256 kB

    Total Files

    31

    Last publish

    Collaborators

    • jordandelcros