001package org.consensusj.analytics.service; 002 003import io.reactivex.rxjava3.core.Single; 004import org.reactivestreams.Publisher; 005 006/** 007 * Interface for reactive rich list service 008 * 009 * @param <N> Numeric type for balances 010 * @param <ID> Type for currency identifiers (e.g. String, Omni Currency ID, etc) 011 */ 012public interface RichListService<N extends Number & Comparable<? super N>, ID> { 013 014 // TODO: Convert Single to CompletableFuture 015 /** 016 * Return a single rich list 017 * 018 * @param currencyID The currency ID 019 * @param numEntries The requested number of entries in the list 020 * @return An RxJava Single for lazy access to the response 021 */ 022 Single<TokenRichList<N, ID>> richList(ID currencyID, int numEntries); 023 024 /** 025 * Get a continuous stream of rich list updates 026 * 027 * @param currencyID The currency ID 028 * @param numEntries The requested number of entries in each list 029 * @return A Publisher for lazy access to the stream 030 */ 031 Publisher<TokenRichList<N, ID>> richListUpdates(ID currencyID, int numEntries); 032}