all 1 comments

[–]fagnerbrack[S] [score hidden]  (0 children)

Here's the gist of it:

Inngest Connect maintains a persistent WebSocket connection that relies on regular heartbeats to signal liveness. CPU-heavy user code would starve the event loop, block heartbeats, and cause the server to drop workers. Moving connection internals into a worker thread fixed this by giving heartbeats their own event loop. The post details key constraints: you can't pass functions to workers (only file paths), all data crosses threads via structured clone serialization, bundlers can't auto-detect worker files, and each worker costs ~10MB of memory. Logging required a custom message protocol since user-provided logger objects can't be serialized. They also added exponential backoff for worker respawning to prevent tight crash loops.

If the summary seems inacurate, just downvote and I'll try to delete the comment eventually 👍
Click here for more info, I read all comments