Thanks to @DavidMaze i simply used queue.put_nowait()
as i run on the same thread.
In hindsight :
- I was using free-flying tasks to handle the case when the queue was full (the queue size was a user-provided setting, and not losing samples.
- Doing this kind of queue overflow data-buffering via tasks (beyond the requested queue size) defeated the purpose of the user-provided queue size
So by using put_nowait() I handled QueueFull exception by logging/counting/dropping, which makes more sense when the user has requested a bound queue.