You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The websockets take some time (around one second) to connect, and authenticated sockets take a little more time to authenticate, so we must wait to the client to call onConnect first.
162
+
163
+
A way of doing this is using a future task
164
+
```java
165
+
var wsClient =newCryptomarketWSSpotTradingClientImpl(KeyLoader.getApiKey(), KeyLoader.getApiSecret());
166
+
var ft =newFutureTask<Object>(() -> {}, newObject());
167
+
wsClient.onConnect(ft);
168
+
wsClient.connect();
169
+
ft.get();
170
+
// here we are connected and authenticated already
0 commit comments