Package org.consensusj.rx.jsonrpc
Interface RxJsonRpcClient
- All Superinterfaces:
AsyncSupport
- All Known Subinterfaces:
PollingChainTipService
,RxJsonChainTipClient
- All Known Implementing Classes:
PollingChainTipServiceImpl
,RxBitcoinClient
RxJava support for calling JSON-RPC clients. Extend/implement this interface to inherit
default
methods
such as pollOnceAsPublisher(Supplier, DefaultRpcClient.TransientErrorFilter)
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.consensusj.jsonrpc.AsyncSupport
AsyncSupport.ThrowingSupplier<T>, AsyncSupport.TransientErrorFilter
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault <RSLT> io.reactivex.rxjava3.core.Single
<RSLT> call
(AsyncSupport.ThrowingSupplier<RSLT> method) Deprecated.default <RSLT> io.reactivex.rxjava3.core.Single
<RSLT> callAsync
(Supplier<CompletionStage<RSLT>> supplier) Deprecated.static <RSLT> io.reactivex.rxjava3.core.Single
<RSLT> defer
(Supplier<CompletionStage<RSLT>> supplier) Deprecated.default <RSLT> io.reactivex.rxjava3.core.Maybe
<RSLT> pollOnce
(AsyncSupport.ThrowingSupplier<RSLT> method) Deprecated.default <T> org.reactivestreams.Publisher
<T> pollOnceAsPublisher
(Supplier<CompletionStage<T>> supplier) 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.default <RSLT> io.reactivex.rxjava3.core.Maybe
<RSLT> pollOnceAsync
(Supplier<CompletionStage<RSLT>> supplier) Deprecated.Methods inherited from interface org.consensusj.jsonrpc.AsyncSupport
getDefaultAsyncExecutor, supplyAsync, supplyAsync
-
Field Details
-
log
-
-
Method Details
-
call
@Deprecated default <RSLT> io.reactivex.rxjava3.core.Single<RSLT> call(AsyncSupport.ThrowingSupplier<RSLT> method) Deprecated.Return a coldSingle
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
- AAsyncSupport.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 coldSingle
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) Deprecated.UsepollOnceAsPublisher(Supplier, TransientErrorFilter)
(Supplier)}Poll a method, ignoringIOError
. The returnedMaybe
will:- Emit a value if successful
- Empty Complete on IOError
- 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 throwException
.- 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, ignoringIOError
. The returnedMaybe
will:- Emit a value if successful
- Empty Complete on IOError
- 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 aCompletableFuture
).- Returns:
- A Maybe for the expected result type
-
pollOnceAsPublisher(Supplier, TransientErrorFilter)
(Supplier)}