|
2 | 2 | # Copyright (c) 2025 aeeeeeep |
3 | 3 |
|
4 | 4 | import logging |
| 5 | +import os |
5 | 6 | from types import ModuleType |
6 | 7 | from typing import Optional, Union, List, Any |
7 | 8 |
|
8 | 9 | from .config import ObjWatchConfig |
9 | 10 | from .tracer import Tracer |
10 | 11 | from .wrappers import ABCWrapper |
11 | 12 | from .runtime_info import runtime_info |
12 | | -from .sinks.consumer import ZeroMQFileConsumer |
| 13 | +from .sinks.consumer import ZeroMQFileConsumer, DynamicRoutingConsumer |
13 | 14 | from .utils.logger import log_info, setup_logging_from_config |
14 | 15 |
|
15 | 16 |
|
@@ -67,14 +68,14 @@ def __init__( |
67 | 68 |
|
68 | 69 | # Initialize ZeroMQ consumer if configured |
69 | 70 | self.consumer = None |
70 | | - if config.output_mode == 'zmq' and config.auto_start_consumer and config.output: |
| 71 | + if config.output_mode == 'zmq' and config.auto_start_consumer: |
71 | 72 | log_info(f"Auto-starting ZeroMQ consumer on endpoint {config.zmq_endpoint}") |
72 | | - self.consumer = ZeroMQFileConsumer( |
| 73 | + # Use DynamicRoutingConsumer for dynamic routing support |
| 74 | + self.consumer = DynamicRoutingConsumer( |
73 | 75 | endpoint=config.zmq_endpoint, |
74 | | - topic=config.zmq_topic, |
75 | | - output_file=config.output, |
76 | 76 | auto_start=True, |
77 | 77 | daemon=True, |
| 78 | + allowed_directories=[os.getcwd()], |
78 | 79 | ) |
79 | 80 |
|
80 | 81 | def start(self) -> None: |
|
0 commit comments