Queue, @task, .delay(),
- results, workflows, resources — the surface you write against.
+ Queue,{" "}
+ @task, .delay()
+ >
+ }
+ node={
+ <>
+ .task(), .enqueue()
+ >
+ }
+ />
+ , results, workflows, resources — the surface you write against.
>
),
role: "what you write",
@@ -83,7 +97,12 @@ export function ArchitectureStack() {
tag: "Rust",
tagKind: "rust",
title: "Engine",
- body: "Scheduler, dispatcher, worker pool, rate limiter — Tokio runtime, OS-thread pool, near-zero Python overhead.",
+ body: (
+ <>
+ Scheduler, dispatcher, worker pool, rate limiter — Tokio runtime,
+ OS-thread pool, near-zero ResourceRuntime initializes resources at worker
startup in topological order, then injects requested ones (via{" "}
- inject= or Inject["name"]) as kwargs.
- Task-scoped resources come from a semaphore pool.
+ inject= or Inject["name"]
+ >
+ }
+ node={
+ <>
+ inject: or useResource()
+ >
+ }
+ />
+ ). Task-scoped resources come from a semaphore pool.
>
),
},
diff --git a/docs/app/components/diagrams/worker-fork.tsx b/docs/app/components/diagrams/worker-fork.tsx
index 1820d8f0..d7118053 100644
--- a/docs/app/components/diagrams/worker-fork.tsx
+++ b/docs/app/components/diagrams/worker-fork.tsx
@@ -1,6 +1,8 @@
+import { SdkSwap } from "@/components/sdk-text";
+
// Worker pool — exact port of the prototype's `.archstack` + `.fork-route` +
// `.archfork` (scheduler routes by task type; sync OS-thread pool vs async pool).
-// `architecture/worker-pool.mdx`.
+// The per-runtime details adapt to the active SDK. `architecture/worker-pool.mdx`.
export function WorkerDispatch() {
return (
async def functions to the async runtime.
+ async}
+ />{" "}
+ functions to the async runtime.
std::thread. The GIL is
- acquired per task via Python::with_gil() —
- independent across workers.
+ std::thread. The
+ GIL is acquired per task via{" "}
+ Python::with_gil() — independent across
+ workers.
+ >
+ }
+ node={
+ <>
+ Sync handlers run on an OS-thread pool owned by the Rust
+ core — independent across workers, with no event loop to
+ block.
+ >
+ }
+ />
async def tasks are dispatched to an{" "}
- AsyncTaskExecutor on a Python daemon thread;{" "}
- PyResultSender bridges results back.
+ async def tasks are dispatched to an{" "}
+ AsyncTaskExecutor on a Python daemon thread;{" "}
+ PyResultSender bridges results back.
+ >
+ }
+ node={
+ <>
+ async handlers run on a native async pool —
+ no thread per job; each runs on your Node event loop and
+ its promise is awaited back into the core.
+ >
+ }
+ />
- A Rust-powered task queue with a first-class{" "}
- {isNode ? "Node.js" : "Python"} SDK over one core and one store
- — no broker. Start on SQLite, scale to{" "}
- Postgres.
+ A Rust-powered task queue with a first-class {label} SDK over
+ one core and one store — no broker. Start on SQLite,
+ scale to Postgres.
.task()} />`.
+ * Missing SDK falls back to `fallback` → default SDK → first provided. */
+export function SdkSwap({
+ fallback,
+ ...bySdk
+}: Partial