Skip to content

Commit 45cebc9

Browse files
committed
support dynamic routing zmq
1 parent f5e1ce2 commit 45cebc9

7 files changed

Lines changed: 748 additions & 7 deletions

File tree

objwatch/core.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
# Copyright (c) 2025 aeeeeeep
33

44
import logging
5+
import os
56
from types import ModuleType
67
from typing import Optional, Union, List, Any
78

89
from .config import ObjWatchConfig
910
from .tracer import Tracer
1011
from .wrappers import ABCWrapper
1112
from .runtime_info import runtime_info
12-
from .sinks.consumer import ZeroMQFileConsumer
13+
from .sinks.consumer import ZeroMQFileConsumer, DynamicRoutingConsumer
1314
from .utils.logger import log_info, setup_logging_from_config
1415

1516

@@ -67,14 +68,14 @@ def __init__(
6768

6869
# Initialize ZeroMQ consumer if configured
6970
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:
7172
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(
7375
endpoint=config.zmq_endpoint,
74-
topic=config.zmq_topic,
75-
output_file=config.output,
7676
auto_start=True,
7777
daemon=True,
78+
allowed_directories=[os.getcwd()],
7879
)
7980

8081
def start(self) -> None:

0 commit comments

Comments
 (0)