|
Clio
develop
The XRP Ledger API server.
|
The RPC engine that ties all RPC-related functionality together. More...
#include <RPCEngine.hpp>
Public Member Functions | |
| RPCEngine (util::config::ClioConfigDefinition const &config, std::shared_ptr< BackendInterface > const &backend, std::shared_ptr< etlng::LoadBalancerInterface > const &balancer, web::dosguard::DOSGuardInterface const &dosGuard, WorkQueue &workQueue, CountersType &counters, std::shared_ptr< HandlerProvider const > const &handlerProvider) | |
| Construct a new RPCEngine object. | |
| Result | buildResponse (web::Context const &ctx) |
| Main request processor routine. | |
| template<typename FnType> | |
| bool | post (FnType &&func, std::string const &ip) |
| Used to schedule request processing onto the work queue. | |
| void | notifyComplete (std::string const &method, std::chrono::microseconds const &duration) |
| Notify the system that specified method was executed. | |
| void | notifyFailed (std::string const &method) |
| Notify the system that specified method failed to execute due to a recoverable user error. | |
| void | notifyErrored (std::string const &method) |
| Notify the system that specified method failed due to some unrecoverable error. | |
| void | notifyTooBusy () |
| Notify the system that the RPC system is too busy to handle an incoming request. | |
| void | notifyNotReady () |
| Notify the system that the RPC system was not ready to handle an incoming request. | |
| void | notifyBadSyntax () |
| Notify the system that the incoming request did not specify the RPC method/command. | |
| void | notifyUnknownCommand () |
| Notify the system that the incoming request specified an unknown/unsupported method/command. | |
| void | notifyInternalError () |
| Notify the system that the incoming request lead to an internal error (unrecoverable). | |
Static Public Member Functions | |
| static std::shared_ptr< RPCEngine > | makeRPCEngine (util::config::ClioConfigDefinition const &config, std::shared_ptr< BackendInterface > const &backend, std::shared_ptr< etlng::LoadBalancerInterface > const &balancer, web::dosguard::DOSGuardInterface const &dosGuard, WorkQueue &workQueue, CountersType &counters, std::shared_ptr< HandlerProvider const > const &handlerProvider) |
| Factory function to create a new instance of the RPC engine. | |
The RPC engine that ties all RPC-related functionality together.
|
inline |
Construct a new RPCEngine object.
| config | The config to use |
| backend | The backend to use |
| balancer | The load balancer to use |
| dosGuard | The DOS guard to use |
| workQueue | The work queue to use |
| counters | The counters to use |
| handlerProvider | The handler provider to use |
|
inline |
Main request processor routine.
| ctx | The Context of the request |
|
inlinestatic |
Factory function to create a new instance of the RPC engine.
| config | The config to use |
| backend | The backend to use |
| balancer | The load balancer to use |
| dosGuard | The DOS guard to use |
| workQueue | The work queue to use |
| counters | The counters to use |
| handlerProvider | The handler provider to use |
|
inline |
Notify the system that specified method was executed.
| method | |
| duration | The time it took to execute the method specified in microseconds |
|
inline |
Notify the system that specified method failed due to some unrecoverable error.
Used for errors such as database timeout, internal errors, etc.
| method |
|
inline |
Notify the system that specified method failed to execute due to a recoverable user error.
Used for errors based on user input, not actual failures of the db or clio itself.
| method |
|
inline |
Notify the system that the RPC system was not ready to handle an incoming request.
This happens when the backend is not yet have a ledger range
|
inline |
Used to schedule request processing onto the work queue.
| FnType | The type of function |
| func | The lambda to execute when this request is handled |
| ip | The ip address for which this request is being executed |