Expand description
Worker-side gRPC client for ZLayer’s worker tier.
Lifecycle:
- On startup: load persisted mTLS identity (cert + key) if present;
otherwise read the bootstrap token, generate a fresh EC P-256 keypair,
build a PKCS#10 CSR, call
Register, persist the signed cert + key- ca chain under
<data_dir>/worker/identity/.
- ca chain under
- Background loops (each spawned as its own
JoinHandle):WatchAssignments: server-streaming; receiveAssignmentEvents and forward them viaassignment_txto the agent’s executor.ReportStatus: bidi-streaming; tick at(next_ttl_secs - jitter)sending aStatusReportsnapshot; receiveStatusAckand updatenext_ttl_secs.WatchCommands: server-streaming; receiveCommandEvents and forward viacommand_tx.
- On disconnect: exponential backoff capped at 60s; on reconnect send a
full snapshot (
StatusReport.full_snapshot = true).
Implements zlayer_scheduler::cluster::WorkerClient so a WorkerTierCluster
in worker mode can route Cluster trait calls through this.
Structs§
- Worker
Client Impl - Worker-side gRPC client. Construct via
WorkerClientImpl::new, then spawn the background loops withWorkerClientImpl::start. - Worker
Identity - Worker mTLS identity persisted to disk.
Enums§
- Worker
Client Error - Errors produced by the worker client.
Traits§
- Worker
Status Provider - Status snapshot provider for the worker. The agent’s
ServiceManagerimplements this so the worker client can report current container state