// the attribute $hubIsActive to true
$nodeInstance->activateHub($requestInstance, $responseInstance);
+ // Debug message
+ $this->debugOutput('MAIN: --- Entering main loop. ---');
+
// ----------------------------- 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
+ while ($nodeInstance->isHubActive()) {
+ // Handle the listeners
+ // @TODO We may have to catch some exceptions here
+ $nodeInstance->getListenerPoolInstance()->handleListenerPool();
+
+ // Handle the qeues
+ $nodeInstance->getQueryInstance()->handleQueues();
+ } // END - while
+
+ // Debug message
+ $this->debugOutput('MAIN: --- Leaving main loop. ---');
}
/**
$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_deinit_queues_filter'));
$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_listener_pool_filter'));
- // This is the last filter
+ // This is the last generic filter
$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('hub_shutdown_node_filter'));
}
}