* @return void
*/
public final function entryPoint () {
- // --------------------- Init phase ---------------------
+ // ----------------------------- Init phase ---------------------------
// The default node-mode is from our configuration
$nodeMode = $this->getConfigInstance()->readConfig('node_mode');
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();
}
/**
public function handleFatalMessages (array $messageList) {
// Walk through all messages
foreach ($messageList as $message) {
- die("MSG:".$message);
+ die("MSG:" . $message);
}
}