Closed XunMengWinter closed 8 years ago
As per the discussion here this library should never call Looper.prepare()
. I believe this is needed since the library uses Reservoir<T>
incorrectly and not Supplier<Result<T>
as I have suggested. Using Reservoir<T>
turns the values into not only a Receiver
(incorrectly so, since it's not using the fact) but also into an Observable
(also, incorrectly, since it's not using this either).
This problem, and the problem with turning every thread that's ever used with this library into a looper thread, will go away if my suggestions are followed.
@ernstsson Pretty cool!
@ernstsson Ha ha, very happy to see your help.
@XunMengWinter
I am busy with my work recently, only write open source at night. But I am going to use Supplier
to instead of Reservoir
, wait for some time please, and I want to know: If write Supplier<Result<T>>
, can you accept it?
public static void prepare() {
prepare(true);
}
private static void prepare(boolean quitAllowed) {
if (sThreadLocal.get() != null) {
throw new RuntimeException("Only one Looper may be created per thread");
}
sThreadLocal.set(new Looper(quitAllowed));
}
A thread can be executed once Looper.prepare()
It has fixed in #2
hi, @drakeet can you accept this?π
Supplier<Result<Response<BoloHttpResult<IdentityList>>>> getIdentityList();
@70kg Chinese has a word called: "η΅εΌΊιδΌ(far-fetched)". ππ
// retrofit-agera-call-adapter-master/agera-call-adapter/src/main/java/me/drakeet/retrofit2/adapter/agera/CallResponseReservoir.java
line 45