Project 04 / 05
Cloudflare Workers
In a Worker the thread belongs to V8's event loop, so an async Rust runtime cannot block and sockets are JavaScript streams. Cloudflare's experimental runtime compiles Rust to Emscripten and lets the JavaScript loop drive it. I run real Rust apps on it, find what breaks at each layer, and fix it upstream in Emscripten and workers-rs.

Receipts
- In reviewemscripten-core/emscripten #28098+106 −123[FS] Grow pipe buffers on demand as a ringPipes allocate as data arrives, like Linux, instead of one fixed 64 KiB buffer each.
- Reportedemscripten-core/emscripten #28073 → fixed in #28075The epoll listener schedules one setImmediate per readiness edgeBusy sockets could exhaust workerd's 10,000-timer cap; the wakes are now coalesced.
- Mergedcloudflare/workers-rs #1097+96 −7fix(r2): read Object::range() as a plain JS objectR2 range reads reach Rust intact.
Focused on
- Async Rust on the V8 event loop
- Emscripten
- Rust SDK
Technical highlights
- Async Rust on the V8 event loop: tested the experimental runtime with axum, sqlx and reqwest and reported the gaps, such as four sockets leaked per cancelled request and bytes lost when a request ends.
- Emscripten: pipe buffers that grow on demand as a ring (in review), and an epoll listener that could exhaust workerd's 10,000-timer cap, now fixed upstream.
- Rust SDK: KV, Queues, R2 and Durable Object bindings in workers-rs carry Rust data to JavaScript faithfully, and workerd's TypeScript types match what the runtime returns.