Skip to content

Commit

Permalink
bitrich-info#502 batch kraken resubscribing
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Chertalev committed Mar 12, 2020
1 parent 053bf0a commit 5c34f03
Show file tree
Hide file tree
Showing 3 changed files with 290 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
import info.bitrich.xchangestream.kraken.dto.enums.KrakenSubscriptionName;
import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper;
import io.reactivex.Observable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.knowm.xchange.currency.CurrencyPair;
Expand All @@ -27,6 +20,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

/** @author makarid, pchertalev */
public class KrakenStreamingMarketDataService implements StreamingMarketDataService {

Expand Down Expand Up @@ -144,8 +145,8 @@ public Observable<List> subscribe(String channelName, int maxItems, Integer dept
}

private String getChannelName(
KrakenSubscriptionName subscriptionName, CurrencyPair currencyPair) {
String pair = currencyPair.base.toString() + "/" + currencyPair.counter.toString();
KrakenSubscriptionName subscriptionName, CurrencyPair currencyPair) {
String pair = KrakenAdapters.adaptCurrencyPair(currencyPair.base.getCurrencyCode() + currencyPair.counter.getCurrencyCode()).toString();
return subscriptionName + KRAKEN_CHANNEL_DELIMITER + pair;
}

Expand Down
Loading

0 comments on commit 5c34f03

Please sign in to comment.