observablehq / framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
https://observablehq.com/framework/
ISC License
2.53k stars 121 forks source link

Web worker code blocks #149

Open Fil opened 12 months ago

Fil commented 12 months ago

A js or ts code block could have an option that moves it to a web worker.

It might not be guaranteed to work (inputs and outputs must be serializable, among other constraints), but when it can work, it would be nice to make it as easy as adding a worker=true option.

Ref. https://observablehq.com/@fil/worker

Fil commented 3 months ago

Jason Miller's greenlet and workerize are useful helpers: https://observablehq.observablehq.cloud/pangea/party/greenlet