Hello I'm trying to use trio with two asyncronous functions and a message in between. but it doesn't launch the consumer and I don't really understand why . The producer sends well in the'queue' and does not send anything once it is saturated. But the consumer doesn't go for it. Or am I making a mistake? Thank you in advance
import time
import trio
async def producer(queue):
while True:
time.sleep(1)
if queue.full() is False:
queue.put_nowait(1)
print(queue.full())
print('put')
async def consumer(queue):
while True:
time.sleep(4)
if queue.full() is True:
print(queue.get_nowait())
print(queue.full())
print('get')
async def main():
queue = trio.Queue(capacity=4)
async with trio.open_nursery() as nursery:
# Two producers
nursery.start_soon(consumer, queue)
nursery.start_soon(producer, queue)
trio.run(main)