Skip to content

bunsvr/cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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();

About

A cluster implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published