tdlib-session-container/src/main/java/it/tdlight/tdlibsession/td/middle/AsyncTdMiddle.java

25 lines
704 B
Java
Raw Normal View History

package it.tdlight.tdlibsession.td.middle;
import it.tdlight.jni.TdApi;
import it.tdlight.tdlibsession.td.TdResult;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
public interface AsyncTdMiddle {
/**
* Receives incoming updates from TDLib.
*
* @return Updates (or Error if received a fatal error. A fatal error means that the client is no longer working)
*/
2021-01-13 04:00:43 +01:00
Flux<TdApi.Object> receive();
/**
* Sends request to TDLib. May be called from any thread.
*
* @param request Request to TDLib.
* @param executeDirectly Execute the function synchronously.
*/
<T extends TdApi.Object> Mono<TdResult<T>> execute(TdApi.Function request, boolean executeDirectly);
}