Replies: 2 comments
|
Yes—for basic worker jobs, I reproduced Bree 9.2.9 running under Bun 1.4.3 on Linux x86_64, including Bree constructs a worker directly, rather than launching a separate Node executable. My worker reported Bun. In an empty directory, run: npm install --save-exact bree@9.2.9 bun@1.4.3Save these two files in that directory.
const { parentPort, workerData } = require('node:worker_threads');
parentPort.postMessage({value: workerData.value, runtime: process.versions.bun ? 'bun' : 'node'});
parentPort.postMessage('done');
const Bree = require('bree');
const path = require('node:path');
const bree = new Bree({
root: false,
logger: false,
jobs: [{ name: 'probe', path: path.join(__dirname, 'job.cjs'),
worker: { workerData: { value: 42 } } }],
workerMessageHandler({ message }) {
if (message !== 'done') console.log(message);
}
});
bree.on('worker deleted', name => console.log('completed:', name));
bree.start().catch(console.error);I ran the locally installed Bun: Bree terminates and removes the worker on |
0 replies
|
We do not use bun nor deno. |
0 replies
Answer selected by
titanism
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We do not use bun nor deno.