2026-05-29 15:26:12 +02:00
|
|
|
"""In-process domain event bus.
|
|
|
|
|
|
|
|
|
|
Domain-agnostic pub/sub. Producers ``await bus.publish(...)``; subscribers
|
|
|
|
|
``bus.subscribe(...)``. Domain modules depend on it, never the reverse.
|
|
|
|
|
|
|
|
|
|
from app.event_bus import bus
|
refactor(backend): rename search_space -> workspace across app bulk (Phase 2 Wave D)
Scoped codemod over surfsense_backend/app (excluding routes/, Wave E): renames
search_space_id -> workspace_id, search_space -> workspace, SearchSpace -> Workspace
across services, utils, tasks, agents, gateway, event_bus, notifications, podcasts,
automations, observability params, and prompt .md files. Also flips the camelCase
payload key searchSpaceId -> workspaceId (no backend reader; hard cutover).
Preserved carve-outs (verbatim): Celery task names "delete_search_space_background"
and "ai_sort_search_space" (wire names), and the OTel/metric key "search_space.id"
(dashboards depend on it). Enum values 'SEARCH_SPACE' and SearchSourceConnector
untouched.
2026-06-26 18:30:47 +02:00
|
|
|
await bus.publish("document.indexed", {"document_id": 42}, workspace_id=7)
|
2026-05-29 15:26:12 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-05-29 22:15:18 +02:00
|
|
|
from . import events # noqa: F401 — populates the event-type catalog
|
2026-05-29 15:26:12 +02:00
|
|
|
from .bus import EventBus, Subscriber, bus
|
2026-05-29 22:15:18 +02:00
|
|
|
from .catalog import EventCatalog, EventType, catalog
|
2026-05-29 15:26:12 +02:00
|
|
|
from .event import Event
|
|
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
|
"Event",
|
|
|
|
|
"EventBus",
|
2026-05-29 22:15:18 +02:00
|
|
|
"EventCatalog",
|
|
|
|
|
"EventType",
|
2026-05-29 15:26:12 +02:00
|
|
|
"Subscriber",
|
|
|
|
|
"bus",
|
2026-05-29 22:15:18 +02:00
|
|
|
"catalog",
|
2026-05-29 15:26:12 +02:00
|
|
|
]
|