🎉 svc-infra v1.0 is here — Production-ready backend infrastructure
What's new
Nfrax Docs logoNfrax Docs

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

Nfrax Docs logoNfrax Docs
Start HereWhat's New
GitHub
svc-infra / API Reference

JobRegistry

from svc_infra.jobs.registry import JobRegistry
View source
svc_infra.jobs.registry

Registry for job handlers with dispatch and metrics. Provides a centralized way to register job handlers and dispatch jobs to them with optional timeout and Prometheus metrics.

Attributes

metric_prefix: Prefix for Prometheus metric names (default: "jobs")

Example

registry = JobRegistry(metric_prefix="myapp_jobs") # Register with decorator @registry.handler("process_order") async def handle_order(job: Job) -> JobResult: order_id = job.payload["order_id"] return JobResult(success=True, message=f"Processed order {order_id}") # Register imperatively registry.register("send_notification", send_notification_handler) # Dispatch result = await registry.dispatch(job, timeout=60.0)

Constructor
JobRegistry(metric_prefix: str = 'jobs') -> None
ParameterTypeDefaultDescription
metric_prefixstr'jobs'Prefix for Prometheus metric names.

Methods

On This Page

Constructordispatchasyncget_handlerhandlerhas_handlerlist_handlersregister