mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Serialize Application start up:
These changes ensure the caller can block until the Application object can be fully prepared (especially listening sockets). Solves the problem where tests can attempt connections before the server sockets are ready. * WebSocket blocks until listening * Application setup blocks until prepared and started
This commit is contained in:
committed by
Nik Bougalis
parent
07c4262392
commit
77c0236cae
@@ -506,6 +506,7 @@ public:
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void setup() override;
|
||||
void doStart() override;
|
||||
void run() override;
|
||||
bool isShutdown() override;
|
||||
void signalStop() override;
|
||||
@@ -1095,17 +1096,15 @@ void ApplicationImp::setup()
|
||||
}
|
||||
|
||||
void
|
||||
ApplicationImp::run()
|
||||
ApplicationImp::doStart()
|
||||
{
|
||||
// VFALCO NOTE I put this here in the hopes that when unit tests run (which
|
||||
// tragically require an Application object to exist or else they
|
||||
// crash), the run() function will not get called and we will
|
||||
// avoid doing silly things like contacting the SNTP server, or
|
||||
// running the various logic threads like Validators, PeerFinder, etc.
|
||||
prepare ();
|
||||
start ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ApplicationImp::run()
|
||||
{
|
||||
{
|
||||
if (!config_->RUN_STANDALONE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user