If maxsize is less than or equal to zero, the queue size is infinite. If
it is an integer greater than 0, then yieldfromput() will block
when the queue reaches maxsize, until an item is removed by get().

Unlike the standard library queue, you can reliably know this Queue’s
size with qsize(), since your single-threaded asyncio application won’t
be interrupted between calling qsize() and doing an operation on the
Queue.

The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer thread calls
task_done() to indicate that the item was retrieved and all work on
it is complete. When the count of unfinished tasks drops to zero,
join() unblocks.