thoth.ingestion.singletons

Singleton management for ingestion worker services.

This module provides singleton instances for shared services to avoid circular imports between worker.py and flows modules.

Functions

get_job_manager()

Return the global JobManager singleton (creates on first call).

get_source_registry()

Return the global SourceRegistry singleton (creates on first call).

get_task_queue()

Return the global TaskQueueClient singleton (creates on first call).

Classes

JobManager([project_id])

Manages job state in Firestore.

SourceRegistry()

Registry for managing data source configurations.

TaskQueueClient([project_id, location, ...])

Client for enqueueing tasks to Cloud Tasks.

thoth.ingestion.singletons.get_source_registry() SourceRegistry[source]

Return the global SourceRegistry singleton (creates on first call).

Returns:

SourceRegistry instance.

thoth.ingestion.singletons.get_job_manager() JobManager[source]

Return the global JobManager singleton (creates on first call).

Returns:

JobManager instance.

thoth.ingestion.singletons.get_task_queue() TaskQueueClient[source]

Return the global TaskQueueClient singleton (creates on first call).

Returns:

TaskQueueClient instance (reads queue config from env).