Skip to content

Commit

Permalink
ADD version 1.0.6 -> return fromWho from manager sending to have the …
Browse files Browse the repository at this point in the history
…close id agent

Signed-off-by: slohan <[email protected]>
  • Loading branch information
Aslhans committed Sep 13, 2019
1 parent 49d47b4 commit 121a37f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions regularflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

from .apiFlow import newAgent
from .apiFlow import cycleManager



Expand Down
2 changes: 1 addition & 1 deletion regularflow/apiFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def newAgent(myId:int, consumerConfig: dict, producerConfig: dict, clusterTopic:
return agent

def cycleManager(agents: list, nbs: list) :
for i in range(agents) :
for i in range(len(agents)) :
agents[i].nbIteration = nbs[i]

2 changes: 1 addition & 1 deletion regularflow/utils_regularflow/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _managementCycleLife(self) :
jsonData = loads(msg.value().decode('utf-8'))
print(jsonData)
sleep(1)
self.communication._managementDataSending(jsonData)
fromWho = self.communication._managementDataSending(jsonData)
if i > self.nbIteration :
self.communication.consumer.close()
data = {"from": -1, "close": -1}
Expand Down
3 changes: 2 additions & 1 deletion regularflow/utils_regularflow/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def _managementDataSending(self, jsonData: dict) :
self._sendTo(data, fromWho, self.clusterTopic)
elif jsonData[key][INDEXCAR] > 0 :
data = {"from": -1, "cars": jsonData[key][INDEXCAR] - 1}
self._sendTo(data, fromWho, self.clusterTopic)
self._sendTo(data, fromWho, self.clusterTopic)
return fromWho

#<-------------------------------------- LISTENING -------------------------------------------------------------------------->

Expand Down
1 change: 1 addition & 0 deletions regularflow/utils_regularflow/refreshTopic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
adminClient.delete_topics(["__consumer_offsets"])
for i in range(len(topicList)) :
newTopics.append(NewTopic(topicList[i], partitions[i] , replications[i]))
print(newTopics)
adminClient.create_topics(newTopics)


2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from setuptools import setup, find_packages


__version__ = "1.0.3"
__version__ = "1.0.6"

try:
# for pip >= 10
Expand Down

0 comments on commit 121a37f

Please sign in to comment.