Skip to content
Discussion options

You must be logged in to vote

Great questions!

Embedded vs TCP: what to choose

Since you already have a production API running in the same process and you want to offload heavy work, embedded mode with SandboxedWorker is actually the right choice for your use case. Each SandboxedWorker runs in an isolated Bun Worker thread with its own heap, so it won't block your API's event loop or compete for the same memory. That's exactly the separation you're looking for.

The TCP (server mode) alternative would be: run bunqueue start as a separate systemd service, then connect your app via new Worker(queue, processor, { connection: { port: 6789 } }). This gives you process-level isolation (separate PID) and lets you scale the qu…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by arthurvanl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
documentation Improvements or additions to documentation
2 participants