Skip to content

PastelStoic/tsworkers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

TSWorkers is a streamlined way to set up workers for multithreaded programs. Setting up a worker takes a single line of code, as shown below:

export const createExampleWorker = setupWorker(
  import.meta.url,
  self,
  myFunction,
);

From there, any part of the code can create a simplified worker:

const worker = createExampleWorker();
const output = await worker.run();

Both input and output of the given function can be anything serializable, and will return as smoothly as if the code was running on the main thread.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published