Robospice with Retrofit asynchrone request
Hello all, I am using robospice with retrofit module to make http request and for some reasons I have to use Asynchrone method with retrofit.
I'am wondering how to use asynchrone method with robospice ? could you please tell me how to declare RetrofitSpiceRequest with asynchrone request ?
Thank you
Hello,
Just use SpiceManager methods that take in a SpiceRequest and a ResponseListener<T>. Request is sync/async agnostic. What makes it executed asynchronously is the way you execute it on SpiceManager.
Cheers, Maciej
Hello @maciejpigulski I'am sorry but I don't get you, could you please give me an example ?
I used this way getSpiceManager().execute(new SpiceRequest , new ResponseListener());
And I dont know how can I put the callback<T> on RetrofitSpiceRequest<T, T>
Hello @Deep21 Here are sorts of examples https://github.com/octo-online/RoboSpice-samples
Sorry, I was on vacation.
@Deep21, you don't put anything on the SpiceRequest directly, new ResponseListener() is the callback that will get called with the result from SpiceRequest. Check examples that @zhangsl had pointed you too.