Skip to content

Support piscina #19924

@alii

Description

@alii

Piscina.js is a popular worker pool library which does not currently work in Bun

Simple repro:

// parent.ts
import { Piscina } from 'piscina';

const piscina = new Piscina({
	filename: new URL('./child.ts', import.meta.url).href,
});

const result = await piscina.run({ a: 4, b: 6 });
console.log(result);
// child.ts
export default ({ a, b }: {a: number, b: number}) => a + b;
$ bun parent.ts

#19920 added support for node:perf_hooks.createHistogram which was an API blocking piscina, but it does not currently support transferring/serialization for structuredClone/related apis. This could be why piscina does not work yet. We need to investigate! :shipit:

Metadata

Metadata

Assignees

Labels

Workeruses the web or node worker apiecosystemSomething that relates to package or framework compatibilityenhancementNew feature or requestnode.jsCompatibility with Node.js APIsnode:child_process

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions