Skip to content

Commit

Permalink
fix refactor, circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
rajan-chari committed Oct 21, 2024
1 parent 9827848 commit 9d0c04f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
3 changes: 0 additions & 3 deletions samples/apps/cap/py/autogencap/zmq_actor_connector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Agent_Sender takes a zmq context, Topic and creates a
# socket that can publish to that topic. It exposes this functionality
# using send_msg method
import time
import uuid
from typing import Any, Dict
Expand Down
3 changes: 1 addition & 2 deletions samples/apps/cap/py/autogencap/zmq_directory_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import zmq

from autogencap.actor import Actor
from autogencap.zmq_actor_connector import ZMQActorConnector, ZMQActorSender
from autogencap.broker import Broker
from autogencap.constants import Directory_Svc_Topic
from autogencap.debug_log import Debug, Error, Info
Expand All @@ -23,7 +22,7 @@
Error as ErrorMsg,
)
from autogencap.utility import report_error_msg
from autogencap.zmq_runtime import ZMQActorConnector, ZMQActorSender
from autogencap.zmq_actor_connector import ZMQActorConnector, ZMQActorSender

# TODO (Future DirectorySv PR) use actor description, network_id, other properties to make directory
# service more generic and powerful
Expand Down
4 changes: 2 additions & 2 deletions samples/apps/cap/py/autogencap/zmq_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .broker import Broker
from .constants import Termination_Topic
from .debug_log import Debug, Warn
from .zmq_directory_svc import ZMQDirectorySvc
from .proto.CAP_pb2 import ActorInfo, ActorInfoCollection
from .actor_connector import IActorConnector
from .zmq_actor_connector import ZMQActorConnector
Expand All @@ -21,7 +20,7 @@ def __init__(self, start_broker: bool = True):
self._context: zmq.Context = zmq.Context()
self._start_broker: bool = start_broker
self._broker: Broker = None
self._directory_svc: ZMQDirectorySvc = None
self._directory_svc = None
self._log_name = self.__class__.__name__

def __str__(self):
Expand All @@ -38,6 +37,7 @@ def _init_runtime(self):
self._start_broker = False # Don't try to start the broker again
self._broker = None
if self._directory_svc is None:
from .zmq_directory_svc import ZMQDirectorySvc
self._directory_svc = ZMQDirectorySvc(self._context)
self._directory_svc.start(self)
time.sleep(0.25) # Process queued thread events in Broker and Directory
Expand Down
2 changes: 1 addition & 1 deletion samples/apps/cap/py/demo/complex_actor_demo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time

from AppAgents import FidelityAgent, FinancialPlannerAgent, PersonalAssistant, QuantAgent, RiskManager
from app_agents import FidelityAgent, FinancialPlannerAgent, PersonalAssistant, QuantAgent, RiskManager
from autogencap.runtime_factory import RuntimeFactory
from termcolor import colored

Expand Down
2 changes: 1 addition & 1 deletion samples/apps/cap/py/demo/list_agents.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import time
from typing import List

from AppAgents import FidelityAgent, GreeterAgent
from app_agents import FidelityAgent, GreeterAgent
from autogencap.debug_log import Info
from autogencap.proto.CAP_pb2 import ActorInfo
from autogencap.runtime_factory import RuntimeFactory
Expand Down
2 changes: 1 addition & 1 deletion samples/apps/cap/py/demo/simple_actor_demo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from AppAgents import GreeterAgent
from app_agents import GreeterAgent
from autogencap.runtime_factory import RuntimeFactory


Expand Down
2 changes: 1 addition & 1 deletion samples/apps/cap/py/demo/single_threaded.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _paths
from AppAgents import GreeterAgent
from app_agents import GreeterAgent
from autogencap.debug_log import Error
from autogencap.proto.CAP_pb2 import Ping
from autogencap.runtime_factory import RuntimeFactory
Expand Down

0 comments on commit 9d0c04f

Please sign in to comment.