solve circular dependency
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2020-03-30 17:15:59 +02:00
parent 94edf03cf8
commit 77f01db969
3 changed files with 7 additions and 6 deletions

7
app.py
View File

@@ -25,12 +25,13 @@ if __name__ == "__main__":
LOGGER.info("Producer started")
generateduuid = str(uuid)
LOGGER.debug(f"My uuid is {generateduuid}")
consumerlocator = ConsumerLocator(communicator=Communicator())
communicator = Communicator(consumerlocator=consumerlocator,uuid=uuid)
consumerlocator = ConsumerLocator(uuid=generateduuid)
communicator = Communicator(consumerlocator=consumerlocator,uuid=generateduuid)
messagesender = MessageSender(communicator=communicator)
while True:
LOGGER.info(f"Updating consumer list of {generateduuid}")
consumerlocator.updateconsumer()
LOGGER.info("Sending message to consumer")
messagesender.sendmessage()
time.sleep(random.random())