21 lines
572 B
Python
21 lines
572 B
Python
"""Singleton registry for integration service."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from .schemas import IntegrationConfig
|
|
from .service import IntegrationService
|
|
from .shared import Optional
|
|
|
|
_integration_service = None
|
|
|
|
|
|
def get_integration_service(
|
|
config: Optional[IntegrationConfig] = None,
|
|
event_bus=None,
|
|
) -> IntegrationService:
|
|
"""Get singleton integration service instance."""
|
|
global _integration_service
|
|
if _integration_service is None:
|
|
_integration_service = IntegrationService(config, event_bus)
|
|
return _integration_service
|