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