Skip to content

Commit cb2f4e9

Browse files
committed
Revert "give a bit more of flexibility making the broker available to the agent - tests are OK"
This reverts commit 13f7b0b.
1 parent 90ef7e0 commit cb2f4e9

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name = 'zoe-lib-python',
5-
version = '0.1.1',
5+
version = '0.1.0',
66
description = 'Python library for Zoe assistant',
77
url = 'https://github.com/guluc3m/zoe-lib-python',
88
author = 'David Muñoz Díaz',

zoe/deco.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,9 @@ def __init__(self, name, agent, listener=None):
274274
else:
275275
self._listener = KafkaClient(bootstrap, self.incoming, name)
276276
agent.send = self._listener.send
277-
278-
def run(self):
277+
# It is not a good practice to do complex logic in a constructor
278+
# but we want the agent to be launched when the agent is defined
279+
# and not after a '.run()' call or something similar.
279280
self._listener.run()
280281

281282
def incoming(self, body):
@@ -565,7 +566,6 @@ class Agent:
565566

566567
def __init__(self, name):
567568
self._name = name
568-
self.agent = DecoratedAgent(self._name, self)
569569

570-
def __call__(self):
571-
self.agent.run()
570+
def __call__(self, i):
571+
DecoratedAgent(self._name, i())

0 commit comments

Comments
 (0)