Skip to main content

Crate cronoq_server

Crate cronoq_server 

Source
Expand description

§cronoq-server

Runs a cronoq scheduler as a service: clients submit tasks over gRPC (cronoq.v1.Tasks) or HTTP/JSON, remote workers lease them over a bidirectional stream (cronoq.v1.Workers), and operators inspect it via cronoq.v1.Admin, /v1/snapshot and Prometheus /metrics. With the Postgres store, several replicas run active-passive: one leader serves, the others report /readyz = 503 and take over on failure.

The server is designed for a single tenant (one team or trust domain). Tokens can be restricted to pools, which scopes submission, lookups, watches and worker registration, but task keys and resources share one namespace.

Re-exports§

pub use config::Config;
pub use server::Bound;
pub use server::Listeners;
pub use server::run;
pub use server::run_with_listeners;

Modules§

auth
Authentication (bearer tokens, client certificates) and authorization (roles, pool lists).
config
Server configuration (TOML file, with environment variables for secrets).
convert
Conversions between protobuf messages and scheduler types, with input validation.
grpc
gRPC services (cronoq.v1.Tasks, cronoq.v1.Workers, cronoq.v1.Admin) and the request logic shared with the HTTP gateway.
http
HTTP/JSON gateway, health checks and Prometheus metrics.
info
Bounded cache of task details for Get and for result messages.
metrics
Prometheus text exposition built from the scheduler snapshot.
remote
Remote execution: workers connect over gRPC streams and receive leases.
scaler
Webhook scaler: forwards desired worker counts to an external orchestrator.
server
Server assembly: listeners, TLS, store, scheduler and leadership.
shard
Which shard serves which pool, and the answer for requests that belong to another shard.
state
Shared server state.
worker
Rust client for remote workers.