Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/server.h
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | public: | ||||
* RPC will call the function to create a timer that will call func in | * RPC will call the function to create a timer that will call func in | ||||
* *millis* milliseconds. | * *millis* milliseconds. | ||||
* @note As the RPC mechanism is backend-neutral, it can use different | * @note As the RPC mechanism is backend-neutral, it can use different | ||||
* implementations of timers. | * implementations of timers. | ||||
* This is needed to cope with the case in which there is no HTTP server, | * This is needed to cope with the case in which there is no HTTP server, | ||||
* but only GUI RPC console, and to break the dependency of pcserver on | * but only GUI RPC console, and to break the dependency of pcserver on | ||||
* httprpc. | * httprpc. | ||||
*/ | */ | ||||
virtual RPCTimerBase *NewTimer(std::function<void(void)> &func, | virtual RPCTimerBase *NewTimer(std::function<void()> &func, | ||||
int64_t millis) = 0; | int64_t millis) = 0; | ||||
}; | }; | ||||
/** | /** | ||||
* Set the factory function for timers | * Set the factory function for timers | ||||
*/ | */ | ||||
void RPCSetTimerInterface(RPCTimerInterface *iface); | void RPCSetTimerInterface(RPCTimerInterface *iface); | ||||
/** | /** | ||||
* Set the factory function for timer, but only, if unset | * Set the factory function for timer, but only, if unset | ||||
*/ | */ | ||||
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface); | void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface); | ||||
/** | /** | ||||
* Unset factory function for timers | * Unset factory function for timers | ||||
*/ | */ | ||||
void RPCUnsetTimerInterface(RPCTimerInterface *iface); | void RPCUnsetTimerInterface(RPCTimerInterface *iface); | ||||
/** | /** | ||||
* Run func nSeconds from now. | * Run func nSeconds from now. | ||||
* Overrides previous timer <name> (if any). | * Overrides previous timer <name> (if any). | ||||
*/ | */ | ||||
void RPCRunLater(const std::string &name, std::function<void(void)> func, | void RPCRunLater(const std::string &name, std::function<void()> func, | ||||
int64_t nSeconds); | int64_t nSeconds); | ||||
typedef UniValue (*rpcfn_type)(Config &config, | typedef UniValue (*rpcfn_type)(Config &config, | ||||
const JSONRPCRequest &jsonRequest); | const JSONRPCRequest &jsonRequest); | ||||
typedef UniValue (*const_rpcfn_type)(const Config &config, | typedef UniValue (*const_rpcfn_type)(const Config &config, | ||||
const JSONRPCRequest &jsonRequest); | const JSONRPCRequest &jsonRequest); | ||||
class ContextFreeRPCCommand { | class ContextFreeRPCCommand { | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |