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.58k stars 125 forks source link

Web worker code blocks #149

Open Fil opened 1 year ago

Fil commented 1 year 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 4 months ago

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