From: Roland Häder Date: Sun, 5 Jul 2009 21:11:48 +0000 (+0000) Subject: Stubs added for queue (not yet documented) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=46d78fedc209832f6d4641ef274a7aa5df92eceb;p=hub.git Stubs added for queue (not yet documented) --- diff --git a/application/hub/class_ApplicationHelper.php b/application/hub/class_ApplicationHelper.php index ed5f03642..055d9c988 100644 --- a/application/hub/class_ApplicationHelper.php +++ b/application/hub/class_ApplicationHelper.php @@ -153,7 +153,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica * @return void */ public final function entryPoint () { - // --------------------- Init phase --------------------- + // ----------------------------- Init phase --------------------------- // The default node-mode is from our configuration $nodeMode = $this->getConfigInstance()->readConfig('node_mode'); @@ -185,11 +185,29 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica die('Node mode ' . $nodeMode . ' is invalid.' . "\n"); } - // --------------------- Bootstrapping phase --------------------- + // ----------------------- Bootstrapping phase ------------------------ // Try to bootstrap the node and pass the request instance to it for // extra arguments which mostly override config entries or enable special // features within the hub (none is ready at this development stage) - $nodeInstance->doBootstrapping($requestInstance); + $nodeInstance->doBootstrapping(); + + // ----------------------- Init all query queues ---------------------- + // After the bootstrap is done we need to initialize the query queues + // which will help us to communicate between the "tasks" a hub needs to + // do. + $nodeInstance->initQueryQueues(); + + // ----------------------------- 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 + // and other hubs, flushing all queues and caches. + $nodeInstance->doShutdown(); } /** @@ -202,7 +220,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica public function handleFatalMessages (array $messageList) { // Walk through all messages foreach ($messageList as $message) { - die("MSG:".$message); + die("MSG:" . $message); } } diff --git a/application/hub/main/nodes/regular/class_HubRegularNode.php b/application/hub/main/nodes/regular/class_HubRegularNode.php index 4c497e613..e1c144537 100644 --- a/application/hub/main/nodes/regular/class_HubRegularNode.php +++ b/application/hub/main/nodes/regular/class_HubRegularNode.php @@ -61,6 +61,7 @@ class HubRegularNode extends BaseHubNode implements NodeHelper { * command-line arguments stored in the request instance. The regular node * should communicate with the bootstrap-nodes at this point. * + * @param $requestInstance A Requestable instance * @return void * @todo Implement this method */