mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Refactor InfoSub to remove NetworkOPs dependency
This commit is contained in:
@@ -3233,8 +3233,9 @@ Json::Value RPCHandler::doSubscribe (Json::Value params, LoadType* loadType, App
|
||||
{
|
||||
WriteLog (lsDEBUG, RPCHandler) << boost::str (boost::format ("doSubscribe: building: %s") % strUrl);
|
||||
|
||||
RPCSub::pointer rspSub = boost::make_shared<RPCSub> (getApp ().getIOService (),
|
||||
getApp ().getJobQueue (), strUrl, strUsername, strPassword);
|
||||
RPCSub::pointer rspSub = boost::make_shared <RPCSub> (
|
||||
getApp ().getOPs (), getApp ().getIOService (),
|
||||
getApp ().getJobQueue (), strUrl, strUsername, strPassword);
|
||||
ispSub = mNetOps->addRpcSub (strUrl, boost::dynamic_pointer_cast<InfoSub> (rspSub));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
|
||||
SETUP_LOG (RPCSub)
|
||||
|
||||
RPCSub::RPCSub (boost::asio::io_service& io_service, JobQueue& jobQueue,
|
||||
const std::string& strUrl, const std::string& strUsername, const std::string& strPassword)
|
||||
: m_io_service (io_service)
|
||||
RPCSub::RPCSub (InfoSub::Source& source, boost::asio::io_service& io_service,
|
||||
JobQueue& jobQueue, const std::string& strUrl, const std::string& strUsername,
|
||||
const std::string& strPassword)
|
||||
: InfoSub (source)
|
||||
, m_io_service (io_service)
|
||||
, m_jobQueue (jobQueue)
|
||||
, mUrl (strUrl)
|
||||
, mSSL (false)
|
||||
|
||||
@@ -4,28 +4,28 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef __RPCSUB__
|
||||
#define __RPCSUB__
|
||||
#ifndef RIPPLE_RPCSUB_H_INCLUDED
|
||||
#define RIPPLE_RPCSUB_H_INCLUDED
|
||||
|
||||
// VFALCO TODO replace this macro with a language constant
|
||||
#define RPC_EVENT_QUEUE_MAX 32
|
||||
|
||||
// Subscription object for JSON-RPC
|
||||
// VFALCO TODO Move the implementation into the .cpp
|
||||
//
|
||||
class RPCSub
|
||||
: public InfoSub
|
||||
, LeakChecked <RPCSub>
|
||||
, public LeakChecked <RPCSub>
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<RPCSub> pointer;
|
||||
typedef const pointer& ref;
|
||||
|
||||
RPCSub (boost::asio::io_service& io_service,
|
||||
RPCSub (InfoSub::Source& source, boost::asio::io_service& io_service,
|
||||
JobQueue& jobQueue, const std::string& strUrl,
|
||||
const std::string& strUsername, const std::string& strPassword);
|
||||
|
||||
virtual ~RPCSub ()
|
||||
{
|
||||
;
|
||||
}
|
||||
virtual ~RPCSub () { }
|
||||
|
||||
// Implement overridden functions from base class:
|
||||
void send (const Json::Value& jvObj, bool broadcast);
|
||||
@@ -67,4 +67,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim:ts=4
|
||||
|
||||
Reference in New Issue
Block a user