6 years, 2 months ago.

get current number of events in event queue (or a list of events in the queue by id)

I'm troubleshooting a memory constrained program where I have set up an EventQueue of limited size. I'm looking for a way to check how many events are currently in the event queue and not yet executed. Is this possible?

I do not see a function for doing so in the EventQueue code. Ideally there would be a function that would return an array of IDs for all events in currently in the queue, so that one could for instance look up IDs and use cancel(int id) for those events.

As a workaround, I'm currently looking into populating my own list of event IDs in the EventQueue, using ID returned by EventQueue::call() method, but I'm not sure how to detect if an event for which I have an ID has been executed. Will do some tests, but could use any insights if someone can shed some light on this.

Be the first to answer this question.