Update AsyncTdDirectImpl.java
This commit is contained in:
parent
6bd8f6281b
commit
ab70ca31ef
@ -74,7 +74,7 @@ public class AsyncTdDirectImpl implements AsyncTdDirect {
|
||||
return telegramClientFactory.create(implementationDetails)
|
||||
.flatMapMany(client -> Flux
|
||||
.<TdApi.Object>create(updatesSink -> {
|
||||
client.initialize((TdApi.Object object) -> {
|
||||
Schedulers.boundedElastic().schedule(() -> client.initialize((TdApi.Object object) -> {
|
||||
updatesSink.next(object);
|
||||
// Close the emitter if receive closed state
|
||||
if (object.getConstructor() == UpdateAuthorizationState.CONSTRUCTOR
|
||||
@ -84,7 +84,7 @@ public class AsyncTdDirectImpl implements AsyncTdDirect {
|
||||
closedFromTd.tryEmitValue(true);
|
||||
updatesSink.complete();
|
||||
}
|
||||
}, updatesSink::error, updatesSink::error);
|
||||
}, updatesSink::error, updatesSink::error));
|
||||
|
||||
if (td.tryEmitValue(client).isFailure()) {
|
||||
updatesSink.error(new TdError(500, "Failed to emit td client"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user