public function action_process() { $this->do_fork(function () { Swiftriver_Dropletqueue::process(); exit; }); }
/** * Run the crawlers */ public static function do_crawl() { Kohana::$log->add(Log::INFO, "Crawler started"); Kohana::$log->write(); self::do_schedule(); // If we got some drops, process them if (!Swiftriver_Dropletqueue::isempty()) { Kohana::$log->add(Log::INFO, "Crawler post processing"); Kohana::$log->write(); Swiftriver_Dropletqueue::process(); } Kohana::$log->add(Log::INFO, "Crawler completed"); }
/** * Gets the list of droplets that have already undergone processing * This method should be called by the controller that is responsible * for rendering the processed droplets on the UI * * @return array */ public static function get_processed_droplets() { // Fetch the processed droplets $result = self::$_processed; // Reset the processed queue self::$_processed = array(); return $result; }