]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/commands/console/class_HubConsoleMainCommand.php
Node now initializes listeners again (but in a filtered way)
[hub.git] / application / hub / main / commands / console / class_HubConsoleMainCommand.php
index 052d7ef556b7b958cabdc2ac77b18d44239440c8..cf8a9a78b938eabb8cc257fc1f09eaa5e539e93f 100644 (file)
@@ -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
        }
 
        /**