mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
-- tests improvement
This commit is contained in:
@@ -78,17 +78,6 @@ public class TikTokLiveClient implements LiveClient
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public void connectAsync(Consumer<LiveClient> onConnection) {
|
||||
connectAsync().thenAccept(onConnection);
|
||||
}
|
||||
|
||||
public CompletableFuture<LiveClient> connectAsync() {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
connect();
|
||||
return this;
|
||||
});
|
||||
}
|
||||
|
||||
public void connect() {
|
||||
try {
|
||||
tryConnect();
|
||||
@@ -199,4 +188,15 @@ public class TikTokLiveClient implements LiveClient
|
||||
messageHandler.handleSingleMessage(this, message);
|
||||
}
|
||||
|
||||
|
||||
public void connectAsync(Consumer<LiveClient> onConnection) {
|
||||
connectAsync().thenAccept(onConnection);
|
||||
}
|
||||
|
||||
public CompletableFuture<LiveClient> connectAsync() {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
connect();
|
||||
return this;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user