This commit is contained in:
21
backend/app/main_graph/config.py
Normal file
21
backend/app/main_graph/config.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Main Graph Configuration - Streaming Writer
|
||||
"""
|
||||
from typing import Optional, Callable, Any
|
||||
|
||||
_stream_writer: Optional[Callable[[Any], None]] = None
|
||||
|
||||
def set_stream_writer(writer: Callable[[Any], None]):
|
||||
"""Set the global stream writer"""
|
||||
global _stream_writer
|
||||
_stream_writer = writer
|
||||
|
||||
def get_stream_writer() -> Callable[[Any], None]:
|
||||
"""Get the global stream writer"""
|
||||
global _stream_writer
|
||||
if _stream_writer is None:
|
||||
# Default no-op writer
|
||||
def noop(_):
|
||||
pass
|
||||
return noop
|
||||
return _stream_writer
|
||||
Reference in New Issue
Block a user