solve circular dependency
This commit is contained in:
7
app.py
7
app.py
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user