From 77cc268fb56ee5f12a01a1b246e8c4c054f1544c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 24 Jul 2009 21:37:40 +0000 Subject: [PATCH] Node now initializes listeners again (but in a filtered way) --- application/hub/class_ApplicationHelper.php | 13 ----------- .../console/class_HubConsoleMainCommand.php | 22 +++++++++++++++++-- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/application/hub/class_ApplicationHelper.php b/application/hub/class_ApplicationHelper.php index c3c3efd4c..61afb7bf9 100644 --- a/application/hub/class_ApplicationHelper.php +++ b/application/hub/class_ApplicationHelper.php @@ -204,19 +204,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Launch the hub main routine here $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance); - die("STOP\n"); - - // -------------------------- Hub activation -------------------------- - // Activates the hub by doing some final preparation steps and setting - // the attribute $hubIsActive to true - $nodeInstance->activateHub(); - - // ----------------------------- Main loop ---------------------------- - // This is the main loop. Queried calls should come back here very fast - // so the whole application runs on nice speed. This while-loop goes - // until the hub is no longer active. - while ($nodeInstance->isHubActive()) { - } // END - while // -------------------------- Shutdown phase -------------------------- // Shutting down the hub by saying "good bye" to all connected clients diff --git a/application/hub/main/commands/console/class_HubConsoleMainCommand.php b/application/hub/main/commands/console/class_HubConsoleMainCommand.php index 052d7ef55..cf8a9a78b 100644 --- a/application/hub/main/commands/console/class_HubConsoleMainCommand.php +++ b/application/hub/main/commands/console/class_HubConsoleMainCommand.php @@ -80,8 +80,26 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); $this->debugOutput('BOOTSTRAP: Bootstrap finished.'); - // Still unfinished: - $this->partialStub('Unfinished method.'); + // Get node instance + $nodeInstance = Registry::getRegistry()->getInstance('node'); + + // Sanity-check on it + if (is_null($nodeInstance)) { + // Throws a NullPointerException here + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } // END - if + + // -------------------------- Hub activation -------------------------- + // Activates the hub by doing some final preparation steps and setting + // the attribute $hubIsActive to true + $nodeInstance->activateHub(); + + // ----------------------------- Main loop ---------------------------- + // This is the main loop. Queried calls should come back here very fast + // so the whole application runs on nice speed. This while-loop goes + // until the hub is no longer active. + while ($nodeInstance->isHubActive()) { + } // END - while } /** -- 2.39.2