@dws/muster-worker
TypeScript icon, indicating that this package has built-in type declarations

6.7.2 • Public • Published

Muster Worker

Introduction

Nodes for running a Muster Graph in a standalone Worker thread.

Usage

Create a worker script, standalone from your app, and configure your worker's graph in it. Run workerConnect to enable worker messaging.

import muster from '@dws/muster';
import { workerConnect } from '@dws/muster-worker';

const graph = muster({
  // ...
});

workerConnect(graph, self);

In your app, use the worker to create a connection to the worker's graph. You'll need to pass in the path to your deployed worker script.

import muster, { ref } from '@dws/muster';
import { worker } from '@dws/muster-worker';

const clientApp = muster({
  worker: worker('./my.worker.js'),
  // ...
});

For hints on how to configure webpack to build and deploy your worker script, see the repo's webpack config.

Install

With npm installed, run

$ npm install @dws/muster-worker

License

MIT

Package Sidebar

Install

npm i @dws/muster-worker

Weekly Downloads

0

Version

6.7.2

License

MIT

Unpacked Size

24.8 kB

Total Files

39

Last publish

Collaborators

  • dws-admin