File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 11# Global event bus instance - uses SqliteEventBus for cross-process functionality
22from eval_protocol .event_bus .event_bus import EventBus
3- from eval_protocol .event_bus .sqlite_event_bus import SqliteEventBus
43
5- event_bus : EventBus = SqliteEventBus ()
4+
5+ def _get_default_event_bus ():
6+ from eval_protocol .event_bus .sqlite_event_bus import SqliteEventBus
7+
8+ return SqliteEventBus ()
9+
10+
11+ # Lazy property that creates the event bus only when accessed
12+ class _LazyEventBus (EventBus ):
13+ def __init__ (self ):
14+ self ._event_bus : EventBus | None = None
15+
16+ def _get_event_bus (self ):
17+ if self ._event_bus is None :
18+ self ._event_bus = _get_default_event_bus ()
19+ return self ._event_bus
20+
21+ def __getattr__ (self , name ):
22+ return getattr (self ._get_event_bus (), name )
23+
24+
25+ event_bus : EventBus = _LazyEventBus ()
You can’t perform that action at this time.
0 commit comments