@stricjs/cluster
v2.0.0
Published
A cluster implementation for Bun
Downloads
26
Readme
@stricjs/cluster
A cluster implementation for Bun.
Install
bun i @stricjs/cluster
Usage
import { worker, spawn } from '@stricjs/cluster';
// If current module is a worker
if (worker) Bun.serve({
fetch: () => new Response('Hi'),
// Must use this
reusePort: true
});
// Spawn a number of threads equivalent to available hardware concurrency
else spawn();