@platformatic/bus
v1.53.4
Published
A simple Bus implementation for inter-thread communication.
Downloads
111,422
Keywords
Readme
@platformatic/bus
A simple Bus implementation for inter-thread communication.
Check out the full documentation for Platformatic DB on our website.
Install
npm install @platformatic/bus
Usage
main.js
import { Bus } from '@platformatic/bus'
const bus = new Bus('root')
bus.send('worker', 'message')
worker.js
import { Bus } from '@platformatic/bus'
const bus = new Bus('worker')
bus.on('message', message => console.log(message))
License
Apache 2.0