Class RxBitcoinClient

All Implemented Interfaces:
AutoCloseable, ChainTipClient, ChainTipService, AsyncSupport, JsonRpcClient<JavaType>, JsonRpcTransport<JavaType>, RxJsonRpcClient

A BitcoinClient enhanced with Reactive features. Can use either ZeroMQ or polling to implement ChainTipService.

TODO: answer the below questions

Should this class eventually implement RxBlockchainService or RxBlockchainBinaryService?

Should this class be renamed to RxBitcoinJsonRpcClient and the RxBitcoinClient interface be moved to cj-btc-rx?

  • Constructor Details

  • Method Details

    • pollOnNewBlockAsync

      public <RSLT> org.reactivestreams.Publisher<RSLT> pollOnNewBlockAsync(Supplier<CompletionStage<RSLT>> supplier)
      Repeatedly once-per-new-block poll an async method
      Type Parameters:
      RSLT - The type of the expected result
      Parameters:
      supplier - A supplier (should be an RPC Method) of a CompletionStage
      Returns:
      An Observable for the expected result type, so we can expect one call to onNext per block.
    • chainTipPublisher

      The BitcoinClient must have "connected once" before this is called. This means something else needs to have called something to do that.
      Specified by:
      chainTipPublisher in interface ChainTipService
      Returns:
      a publisher of Chain Tips