Interface RxJsonRpcClient

All Superinterfaces:
AsyncSupport
All Known Subinterfaces:
PollingChainTipService, RxJsonChainTipClient
All Known Implementing Classes:
PollingChainTipServiceImpl, RxBitcoinClient

public interface RxJsonRpcClient extends AsyncSupport
RxJava support for calling JSON-RPC clients. Extend/implement this interface to inherit default methods such as pollOnceAsPublisher(Supplier, DefaultRpcClient.TransientErrorFilter).
  • Field Details

    • log

      static final org.slf4j.Logger log
  • Method Details

    • call

      @Deprecated default <RSLT> io.reactivex.rxjava3.core.Single<RSLT> call(AsyncSupport.ThrowingSupplier<RSLT> method)
      Deprecated.
      Return a cold Single for calling a provided synchronous JSON-RPC method.

      A cold stream does not begin processing until someone subscribes to it.

      Type Parameters:
      RSLT - The type of the expected result
      Parameters:
      method - A AsyncSupport.ThrowingSupplier wrapper for a method call.
      Returns:
      A cold Single for calling the method.
    • callAsync

      @Deprecated default <RSLT> io.reactivex.rxjava3.core.Single<RSLT> callAsync(Supplier<CompletionStage<RSLT>> supplier)
      Deprecated.
    • defer

      @Deprecated static <RSLT> io.reactivex.rxjava3.core.Single<RSLT> defer(Supplier<CompletionStage<RSLT>> supplier)
      Deprecated.
      Return a cold Single for calling a provided asynchronous JSON-RPC method. (Uses a supplier to make sure the async call isn't made until subscription time)

      A cold stream does not begin processing until someone subscribes to it.

      Type Parameters:
      RSLT - The type of the expected result
      Parameters:
      supplier - of completable
      Returns:
      A cold Single for calling the method.
    • pollOnceAsPublisher

      default <T> org.reactivestreams.Publisher<T> pollOnceAsPublisher(Supplier<CompletionStage<T>> supplier, AsyncSupport.TransientErrorFilter filter)
      Takes a supplier of computable futures and returns a publisher that when subscribed to returns 0 or 1 items.
      Type Parameters:
      T - result type
      Parameters:
      supplier - supplier for delaying invocation of "hot" futures so they can be "cold" publishers.
      filter - Filters and logs transient errors
      Returns:
      A publisher of a "cold" stream of items (temporarily Flowable, but will change to Publisher, then Flow.Publisher)
    • pollOnceAsPublisher

      default <T> org.reactivestreams.Publisher<T> pollOnceAsPublisher(Supplier<CompletionStage<T>> supplier)
    • pollOnce

      @Deprecated default <RSLT> io.reactivex.rxjava3.core.Maybe<RSLT> pollOnce(AsyncSupport.ThrowingSupplier<RSLT> method)
      Poll a method, ignoring IOError. The returned Maybe will:
      1. Emit a value if successful
      2. Empty Complete on IOError
      3. Error out if any other Exception occurs
      Type Parameters:
      RSLT - The type of the expected result
      Parameters:
      method - A supplier (should be an RPC Method) that can throw Exception.
      Returns:
      A Maybe for the expected result type
    • pollOnceAsync

      @Deprecated default <RSLT> io.reactivex.rxjava3.core.Maybe<RSLT> pollOnceAsync(Supplier<CompletionStage<RSLT>> supplier)
      Deprecated.
      Poll a method, ignoring IOError. The returned Maybe will:
      1. Emit a value if successful
      2. Empty Complete on IOError
      3. Error out if any other Exception occurs
      Type Parameters:
      RSLT - The type of the expected result
      Parameters:
      supplier - A supplier (should call an async RPC Method and return a CompletableFuture).
      Returns:
      A Maybe for the expected result type