I have an application that works with a queue with strings (which corresponds to the various tasks that the application must perform). In random moments, the queue can be filled with lines (sometimes several times per minute, but it can also take several hours.
Until now, I always had a timer that checked every few seconds to see if there were any items in the queue and deleted them.
I think there should be a nicer solution than this path. Is there a way to get an event or so when an item is added to the queue?
source
share