File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import it .tdlight .TelegramClient ;
99import it .tdlight .jni .TdApi .Message ;
1010import it .tdlight .jni .TdApi .Update ;
11+ import it .tdlight .util .FutureSupport ;
1112import it .tdlight .util .UnsupportedNativeLibraryException ;
1213import it .tdlight .jni .TdApi ;
1314import it .tdlight .jni .TdApi .ChatListArchive ;
@@ -359,7 +360,7 @@ public void waitForExit() throws InterruptedException {
359360 * Wait until TDLight is closed
360361 */
361362 public CompletableFuture <Void > waitForExitAsync () {
362- return closed .copy ();
363+ return FutureSupport .copy (closed );
363364 }
364365
365366 private void onCloseUpdate () {
Original file line number Diff line number Diff line change 1+ package it .tdlight .util ;
2+
3+ import java .util .concurrent .CompletableFuture ;
4+
5+ public class FutureSupport {
6+
7+ public static <T > CompletableFuture <T > copy (CompletableFuture <T > future ) {
8+ return CompletableFuture .completedFuture (true ).thenCompose (ignored -> future );
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ package it .tdlight .util ;
2+
3+ import java .util .concurrent .CompletableFuture ;
4+
5+ public class FutureSupport {
6+
7+ public static <T > CompletableFuture <T > copy (CompletableFuture <T > future ) {
8+ return future .copy ();
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments