@@ -26,7 +26,7 @@ Add `@offwork.task` to one entry-point function. Call `await func.run(...)`. Tha
2626| Auto-capture (source, imports, closures, classes, module vars) | ` Graph.serialize ` | [ offwork/graph/analyzer.py] ( ../offwork/graph/analyzer.py ) , [ offwork/graph/graph.py] ( ../offwork/graph/graph.py ) |
2727| Reconstruction → self-contained source | ` Graph.reconstruct ` | [ offwork/graph/store.py] ( ../offwork/graph/store.py ) |
2828| Runtime call-stack tracing | ` contextvars ` | [ offwork/graph/tracing.py] ( ../offwork/graph/tracing.py ) |
29- | Remote submit / await | ` func.run ` , ` func.start ` , ` func.map ` | [ offwork/worker/remote.py] ( ../offwork/worker/remote.py ) , [ offwork/graph/decorator.py] ( ../offwork/graph/decorator.py ) |
29+ | Remote submit / await | ` func.run ` , ` func.submit ` , ` func.map ` | [ offwork/worker/remote.py] ( ../offwork/worker/remote.py ) , [ offwork/graph/decorator.py] ( ../offwork/graph/decorator.py ) |
3030| Worker loop (signing, scheduling, throttle, heartbeat) | ` serve ` | [ offwork/worker/remote.py] ( ../offwork/worker/remote.py ) |
3131| Subgraph caching, reconstruct, retry, timeout | ` Worker.run_with_policy ` | [ offwork/worker/worker.py] ( ../offwork/worker/worker.py ) |
3232| Auto-install of third-party packages | ` install_package_as ` , ` ensure_dependencies ` | [ offwork/worker/deps.py] ( ../offwork/worker/deps.py ) |
@@ -39,6 +39,7 @@ Add `@offwork.task` to one entry-point function. Call `await func.run(...)`. Tha
3939| Local TCP backend | ` local:// ` | [ offwork/worker/backends/local.py] ( ../offwork/worker/backends/local.py ) |
4040| Redis backend | ` redis:// ` | [ offwork/worker/backends/redis.py] ( ../offwork/worker/backends/redis.py ) |
4141| RabbitMQ backend | ` amqp:// ` | [ offwork/worker/backends/rabbitmq.py] ( ../offwork/worker/backends/rabbitmq.py ) |
42+ | WebSocket backend (hosted broker) | ` ws:// ` / ` wss:// ` | [ offwork/worker/backends/ws.py] ( ../offwork/worker/backends/ws.py ) |
4243| Docker sandbox isolation | ` --sandbox ` , ` DockerSandbox ` | [ offwork/worker/sandbox/] ( ../offwork/worker/sandbox/ ) |
4344| Signed envelopes (per-client HMAC + Ed25519 + TOFU + replay protection) | ` --require-signing ` , token, pairing, ` offwork clients ` | [ offwork/core/envelope.py] ( ../offwork/core/envelope.py ) , [ offwork/core/ed25519.py] ( ../offwork/core/ed25519.py ) , [ offwork/core/identity.py] ( ../offwork/core/identity.py ) , [ offwork/core/clients.py] ( ../offwork/core/clients.py ) , [ offwork/core/signing.py] ( ../offwork/core/signing.py ) , [ offwork/core/token.py] ( ../offwork/core/token.py ) , [ offwork/core/pairing.py] ( ../offwork/core/pairing.py ) |
4445| Temp venv (for ` --tmp ` and ` offwork run ` ) | ` temp_venv ` | [ offwork/_ venv.py] ( ../offwork/_venv.py ) |
@@ -88,6 +89,7 @@ offwork/
8889 local.py Async TCP broker (auto-spawned subprocess).
8990 redis.py redis.asyncio (RPUSH/BLPOP, Pub/Sub, MGET).
9091 rabbitmq.py aio-pika (durable queue, fanout exchange, TTL queues).
92+ ws.py WebSocketBackend — one persistent WS, multiplexed by request id.
9193 sandbox/
9294 docker.py DockerSandbox: build image, start container, TCP exec.
9395 guest_agent.py Stdlib-only agent running inside the container.
@@ -128,14 +130,21 @@ The `__all__` in [offwork/__init__.py](../offwork/__init__.py) is the public sur
128130
129131- Decorator: ` task ` .
130132- Lifecycle: ` connect(url) ` , ` disconnect() ` , ` serve(url, concurrency=, sandbox=, ...) ` .
133+ ` connect() ` accepts ` local:// ` , ` redis:// ` , ` rediss:// ` , ` amqp:// ` , ` amqps:// ` ,
134+ ` ws:// ` , ` wss:// ` . The ` ws:// ` / ` wss:// ` schemes instantiate ` WebSocketBackend `
135+ (requires ` pip install offwork[ws] ` ).
131136- Power-user: ` Task ` , ` Worker ` , ` Backend ` , ` serialize ` , ` reconstruct ` , ` pack ` , ` execute ` , ` get_graph ` , ` Graph ` .
132137- Result: ` Result ` , ` ResultEnvelope ` , ` ProgressInfo ` , ` progress ` .
133138- Scheduling: ` ScheduleHandle ` .
134139- Errors: ` Error ` (base), ` WorkerError ` , ` RemoteError ` , ` DependencyError ` , ` TaskStalled ` , ` TaskCancelled ` , ` ThrottleError ` , ` SignatureError ` and its subclasses ` ReplayError ` , ` StaleTaskError ` , ` ClientRevokedError ` , ` IdentityMismatchError ` , ` PairingError ` , ` WorkerOnlyError ` .
135140- Auth: ` generate_token ` , ` save_token ` , ` load_token ` , ` clear_token ` , ` resolve_root_token ` , ` compute_signature ` , ` verify_signature ` , ` derive_key ` , ` NonceLRU ` , ` build_signed_envelope ` , ` verify_task_envelope ` , ` KnownClients ` , ` ClientEntry ` , ` get_client_id ` , ` get_identity_seed ` , ` get_public_key ` , ` get_identity_fingerprint ` , ` clear_identity ` , plus pairing helpers.
136141- Sandbox: ` DockerSandbox ` .
137142
138- ` func.run ` , ` func.start ` , ` func.map ` , ` func.run_in ` , ` func.run_at ` , ` func.run_every ` are attributes attached by ` @offwork.task ` ([ graph/decorator.py] ( ../offwork/graph/decorator.py ) ).
143+ ` func.run ` , ` func.submit ` , ` func.map ` , ` func.run_in ` , ` func.run_at ` ,
144+ ` func.run_every ` are attributes attached by ` @offwork.task `
145+ ([ graph/decorator.py] ( ../offwork/graph/decorator.py ) ).
146+ ` func.submit ` is the non-blocking form of ` func.run ` — it returns a
147+ ` Result ` handle without awaiting the result.
139148
140149## Conventions and invariants
141150
0 commit comments