binance-exchange / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
MIT License
831 stars 628 forks source link

Live subscription not live, update once every second only? #394

Open mcmushroom opened 3 years ago

mcmushroom commented 3 years ago

Hi there,

I use the following code to get live subscription to tickers using the API.

ProductSubscription subscription = ProductSubscription.create().addTicker(CurrencyPair.ETH_BTC).build(); exchangeStream.connect(subscription).blockingAwait(); exchangeStream.enableLiveSubscription(); Disposable tickers = exchangeStream.getStreamingMarketDataService().getTicker(CurrencyPair.ETH_BTC).subscribe(ticker -> System.out.println(ticker));

However, I see the updates coming exactly once every second, but I need live updates.

Is there a possibility to get the updates of the tickers instantly, and not in intervals of one second?

Thank you for your help.