Frackinfrell
Frackinfrell

Reputation: 327

Multiple POST Queue for Android w/Retrofit

I'm putting together an Android library that grabs sensor data and posts to an Azure Event Hub. Right now I am using Retrofit and posting the data one at a time from user input.

The next stage is to post the data at very frequent intervals. I get the sensor data at about 20 readings per second. I'm going to capture the data at about 2 per second, then I am going send the two captures to the event hub every second. These intervals will be parameterized to go faster or slower as needed.

In iOS, they have Grand Central Dispatch, which would create the type of throttled queue I'm looking for. I'm wondering what the optimal way to approach this would be in Android?

Upvotes: 0

Views: 473

Answers (1)

Seishin
Seishin

Reputation: 1477

Retrofit doesn't support queues. You have to create your logic to handle it.

Another good REST library which has queues is Volley and will help you with this problem.

Upvotes: 1

Related Questions