bitrich-info / xchange-stream

XChange-stream is a Java library providing a simple and consistent streaming API for interacting with Bitcoin and other crypto currency exchanges via WebSocket protocol. It is build on top of of XChange library providing new interfaces for streaming API. User can subscribe for live updates via reactive streams of RxJava library.
Apache License 2.0
414 stars 219 forks source link

Change Poloniex to have a single subscription for Ticker. Fixes #124 and #98 #521

Closed TSavo closed 4 years ago

TSavo commented 4 years ago

To better support #124 and #98, PoloniexStreamingMarketDataService has been changed to have a single subscription for Ticker which is then shared by all subscribers to the Ticker.

To get all the Tickers in a single observable, it is suggested the client create a list of all currencyPairs on the exchange, and use something like the following:

Observable<Ticker> allTickers = Observable.fromIterable(currencyPairs).flatMap(pair -> streamingMarketDataService.getTicker(pair));

TSavo commented 4 years ago

@badgerwithagun Ditched the expanded API in favor of Poloniex having one shared observable. :)

TSavo commented 4 years ago

@badgerwithagun Great call on the memoizer. This has been rebased to develop and the memoization is now present and tested.

TSavo commented 4 years ago

@badgerwithagun All set. Memoized in it's entirety (not by method reference to share), final, and dependency versions removed.