Synchronous/Asynchronous handling of incoming positions

nejck7 years ago

I have a use case where I have to handle incoming positions asynchronously. I implemented my own Handler and added it to pipeline, but now I found out, that it synchronously handles all the positions that arrive in the same package (ruptela).

Is there any way to ensure the positions get handled synchronously one after another?

Best regards,
Nejc

Anton Tananaev7 years ago

This is a known problem that hasn't been solved yet. It happens for reverse geocoding and geolocation because those requests are asynchronous.

I have one idea on how to solve it. Basically have some handler that would wait for message and sort them into original order. Haven't had a chance to implement it yet. If you implement, please send a pull request.

nejck7 years ago

Actually the Positions here arrive all together in one package, than they get split in ExtendedObjectDecoder... But anyway, the problem is similar. I was thinking about creating a Queue of Positions (per device), and handle them one by one, since I don't have to change the Position itself it should work (hopefully).

Anton Tananaev7 years ago

Let me know how it goes.