Skip to content

API Reference parrot.knowledge.ontology.concept_catalog.worker

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.knowledge.ontology.concept_catalog.worker

View source

Concept Catalog Sync Worker (FEAT-159 TASK-1089).

Drains ontology_concept_outbox rows using SELECT … FOR UPDATE SKIP LOCKED, materialises concept/is_a data to ArangoDB via ArangoOntologyGraphStore, and publishes cache-invalidation messages to Redis pub/sub.

Alias ArangoOntologyGraphStore

Re-exported from parrot.knowledge.ontology.graph_store.ArangoOntologyGraphStore.

Alias CatalogVocabularyPublisher

Re-exported from parrot.knowledge.ontology.vocabulary.catalog_bridge.CatalogVocabularyPublisher.

Class ConceptCatalogSyncWorker

Drain ontology_concept_outbox, sync to ArangoDB, publish invalidation.

Operation dispatch table (class-level) maps outbox operation values to private method names so new operations can be registered without branching.

DLQ policy: after MAX_RETRIES attempts the row is left with processed_at IS NULL and attempts >= MAX_RETRIES; a monitoring query can surface these rows. They are NOT re-enqueued.

Parameter Type Default Description
pg_pool Any asyncpg connection pool.
graph_store ArangoOntologyGraphStore ArangoOntologyGraphStore instance for ArangoDB I/O.
redis_client Any aioredis (or compatible) client for pub/sub publish.
vocabulary_publisher 'CatalogVocabularyPublisher | None' None

Attributes:

Attribute Type Description
OPERATIONS dict[str, str]
MAX_RETRIES int

Method ConceptCatalogSyncWorker.run_once

Drain up to batch_size outbox rows.

Uses FOR UPDATE SKIP LOCKED so two parallel workers process disjoint rows without double-processing.

run_once(batch_size: int = 50) -> int

Parameter Type Default Description
batch_size int 50 Maximum number of rows to process in this call.

Returns: int — Number of rows fetched (not necessarily all successfully processed).

Alias TenantContext

Re-exported from parrot.knowledge.ontology.schema.TenantContext.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally