2021-04-07 19:48:10 +02:00
|
|
|
package it.tdlight.common.internal;
|
2020-10-13 01:31:32 +02:00
|
|
|
|
|
|
|
import it.tdlight.jni.TdApi;
|
|
|
|
import it.tdlight.jni.TdApi.Function;
|
2021-10-22 12:54:28 +02:00
|
|
|
import it.tdlight.tdnative.NativeClient;
|
2020-10-13 01:31:32 +02:00
|
|
|
|
2021-09-27 19:27:13 +02:00
|
|
|
final class NativeClientAccess extends NativeClient {
|
2020-10-13 01:31:32 +02:00
|
|
|
|
|
|
|
public static int create() {
|
|
|
|
return NativeClientAccess.createNativeClient();
|
|
|
|
}
|
|
|
|
|
2021-10-20 23:51:06 +02:00
|
|
|
public static <R extends TdApi.Object> TdApi.Object execute(Function<R> function) {
|
2020-10-13 01:31:32 +02:00
|
|
|
return NativeClientAccess.nativeClientExecute(function);
|
|
|
|
}
|
|
|
|
|
2021-10-20 23:51:06 +02:00
|
|
|
public static <R extends TdApi.Object> void send(int nativeClientId, long eventId, TdApi.Function<R> function) {
|
2020-10-13 01:31:32 +02:00
|
|
|
NativeClientAccess.nativeClientSend(nativeClientId, eventId, function);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int receive(int[] clientIds, long[] eventIds, TdApi.Object[] events, double timeout) {
|
|
|
|
return NativeClientAccess.nativeClientReceive(clientIds, eventIds, events, timeout);
|
|
|
|
}
|
|
|
|
}
|