]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php
Added initial crawler stuff:
[hub.git] / application / hub / main / filter / task / crawler / class_CrawlerTaskHandlerInitializerFilter.php
index a119fec396184a819d8b432137efc159abfac8a3..799f9b60a9eecdb51fbf610c5de824642e573af4 100644 (file)
@@ -64,10 +64,18 @@ class CrawlerTaskHandlerInitializerFilter extends BaseCrawlerFilter implements F
                /*
                 * Register all tasks:
                 *
-                * 1) ...
+                * 1) "Communicator" for crawler->node communication
                 */
-               //$taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_???_task_class');
-               //$handlerInstance->registerTask('crawler_???', $taskInstance);
+               $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_node_communicator_task_class');
+               $handlerInstance->registerTask('crawler_node_communicator', $taskInstance);
+
+               // 2) Local URL fetcher (fetches URLs locally and adds them to the analyzer's input stack)
+               $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_local_url_fetcher_task_class');
+               $handlerInstance->registerTask('crawler_local_url_fetcher', $taskInstance);
+
+               // 3) Remote URL fetcher (let fetch URLs by other crawler nodes and also adds them to the stack)
+               $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_remote_url_fetcher_task_class');
+               $handlerInstance->registerTask('crawler_remote_url_fetcher', $taskInstance);
 
                // Put the task handler in registry
                Registry::getRegistry()->addInstance('task_handler', $handlerInstance);