I am trying to run two infinitely looping functions concurrently and will later implement this into a socket chatroom application for each client that is connected to my server. The problem is, whenever the function that I am trying to gather is run in an infinite while loop, my program will only run the first function that is gathered.
Here is my code:
async def increment():
global money
while True:
money += 1
async def displayMoney():
global money
while True:
input(money)
async def main():
global money
await asyncio.gather(increment(), displayMoney())
asyncio.run(main())
I am new to asynchronous programming, apologies.