Interface RpcCaller
Interface for invoking JSON-RPC methods with typed responses.
Implementations delegate to the underlying transport layer
(e.g., a JsonRpcClient instance). A method reference is typically the clearest
way to adapt a generic invoke method to this interface:
RpcCaller caller = jsonRpcClient::invoke;
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescription<T> CompletableFuture<T>Invokes a JSON-RPC method and returns a future for the typed response.
-
Method Details
-
invoke
Invokes a JSON-RPC method and returns a future for the typed response.- Type Parameters:
T- the expected response type- Parameters:
method- the JSON-RPC method nameparams- the request parameters (may be aMap, DTO record, orJsonNode)resultType- theClassof the expected response type- Returns:
- a
CompletableFuturethat completes with the deserialized result
-