Class PollingChainTipServiceImpl
java.lang.Object
org.consensusj.bitcoin.rx.jsonrpc.PollingChainTipServiceImpl
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ChainTipClient
,ChainTipService
,AsyncSupport
,RxJsonRpcClient
public class PollingChainTipServiceImpl
extends Object
implements ChainTipService, ChainTipClient, RxJsonRpcClient, Closeable
Provides
ChainTipService
a using a BitcoinClient
and a polling interval.
This can be used as a fallback if ZeroMQ is not available.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.consensusj.jsonrpc.AsyncSupport
AsyncSupport.ThrowingSupplier<T>, AsyncSupport.TransientErrorFilter
-
Constructor Summary
ConstructorDescriptionPollingChainTipServiceImpl
(BitcoinClient bitcoinClient) PollingChainTipServiceImpl
(BitcoinClient bitcoinClient, io.reactivex.rxjava3.core.Observable<Long> interval) Construct from aBitcoinClient
or subclass and a polling interval -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.consensusj.jsonrpc.AsyncSupport
getDefaultAsyncExecutor, supplyAsync, supplyAsync
Methods inherited from interface org.consensusj.rx.jsonrpc.RxJsonRpcClient
call, callAsync, pollOnce, pollOnceAsPublisher, pollOnceAsPublisher, pollOnceAsync
-
Constructor Details
-
PollingChainTipServiceImpl
public PollingChainTipServiceImpl(BitcoinClient bitcoinClient, io.reactivex.rxjava3.core.Observable<Long> interval) Construct from aBitcoinClient
or subclass and a polling interval- Parameters:
bitcoinClient
- a client instanceinterval
- a polling interval
-
PollingChainTipServiceImpl
-
-
Method Details
-
start
-
chainTipPublisher
Description copied from interface:ChainTipService
This method will give you a stream of ChainTips- Specified by:
chainTipPublisher
in interfaceChainTipService
- Returns:
- A Publisher for the sequence
-
getPollingInterval
Provide a polling interval- Returns:
- polling interval with desired frequency for polling for new ChainTips.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getChainTipsAsync
- Specified by:
getChainTipsAsync
in interfaceChainTipClient
-
getChainTips
Deprecated.- Specified by:
getChainTips
in interfaceChainTipClient
- Throws:
JsonRpcStatusException
IOException
-