Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.
Apache License 2.0
2.95k
stars
545
forks
source link
Methods that return Future<T> get blocked in the Callable #385
I tried to used methods that return Future with no luck.
Especially getDateOfDataInCache(Class<?> clazz, final Object cacheKey) and removeDataFromCache(final Class clazz, final Object cacheKey).
Both get blocked inside the call() method of the Callable at the line spiceManager.waitForServiceToBeBound(). I have no issues when working on all the async method that need a listener but when I want to do something synchronously, I end up with an ANR on the future.get() method. I may use it the wrong way so any help would be nice.
Here is how I try to retrieve the date of the data:
Hi,
I tried to used methods that return Future with no luck.
Especially getDateOfDataInCache(Class<?> clazz, final Object cacheKey) and removeDataFromCache(final Class clazz, final Object cacheKey).
Both get blocked inside the call() method of the Callable at the line spiceManager.waitForServiceToBeBound(). I have no issues when working on all the async method that need a listener but when I want to do something synchronously, I end up with an ANR on the future.get() method. I may use it the wrong way so any help would be nice.
Here is how I try to retrieve the date of the data:
Future<Date> future = spiceManager.getDateOfDataInCache(Page.class, cacheKey);
Date cacheDate = future.get();
Everything blocks when I call future.get().
Thanks for any upcoming help.
FX