Event Queue Size


Is it possible to limit the size of the Event Queue?
I have a Position handler that is called for every new sample. But it cannot always process the data as fast as it samples, so I end up with a very long queue. I would like to just discard the new sample if it haven’t finished processing the old one.
Any suggestion on how to do that?

Thank you,
Caio Porto


As I understand, if you use le_pos_AddMovementHandler() to handler possitioning:

le_pos_MovementHandlerRef_t le_pos_AddMovementHandler (uint32_t horizontalMagnitude, uint32_t verticalMagnitude, le_pos_MovementHandlerFunc_t handlerPtr, void * contextPtr)
[in] horizontalMagnitude Horizontal magnitude in meters. 0 means that I don’t care about changes in the latitude and longitude.
[in] verticalMagnitude Vertical magnitude in meters. 0 means that I don’t care about changes in the altitude.
[in] handlerPtr
[in] contextPtr

New sample is callback if horizontalMagnitude or verticalMagnitude conditions are met. Hence, your issue should be resolve by define constant variables to estimate
how fast your position sample is catched to avoid queue delay or just use le_gnss_ReleaseSampleRef() whenever you want to discard the sample.
If you don’t mind, posted some code you are struggling with, will very helpful for me to understand clearly your issues.