1.0.1 • Published 6 years ago

@axc/thread-manager v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Thread Manager

Library designed to facilitate using multiple WebWorkers

Thread manager offers features such as a middleware system and different work distribution methods to optimize the load across the pools of workers. It works in web and electron environments.

Install

    npm install @axc/thread-manager --save

Use

// This example sends 'Hello world' and the worker sends it back to the main script so that its printed

//in your index.js
import {ThreadManager} from '@axc/thread-manager'

const TaskManager = new ThreadManager('./path/to/your/worker/script.js');

TaskManager.setMessageHandler = (e)=>{
    console.log(e.data);
    //yields 'Hello world'
}

TaskManager.sendMessage('Hello world');


//in your worker.js

onmessage = function(e) {
    postMessage(e.data);
}

Documentation

You can check the documentation here

1.0.1

6 years ago

1.0.0

6 years ago

0.1.12

6 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago