summaryrefslogtreecommitdiff
path: root/tools/worker.php
diff options
context:
space:
mode:
authorBenjamin Southall <applemansigloo@gmail.com>2016-09-25 16:34:47 +0900
committerBenjamin Southall <applemansigloo@gmail.com>2016-09-25 16:34:47 +0900
commita3b9c4405c6d4cca2a70dbb400e3ba3f65e7ea04 (patch)
tree5a2ebdb801748586e3fde7c12cbeda169b2c3e31 /tools/worker.php
parent9436524a306c8e3d6d8a6ed195e2a3c56d5cde39 (diff)
parenta4b619ae5eaab5755dc215a496854dee8f7ce395 (diff)
Merged lainchan with vichan master at 25/9/2016 a4b619ae5eaab5755dc215a496854dee8f7ce395 @czaks czaks committed on GitHub 2 days ago
Diffstat (limited to 'tools/worker.php')
-rwxr-xr-xtools/worker.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/worker.php b/tools/worker.php
new file mode 100755
index 00000000..e19fe1c6
--- /dev/null
+++ b/tools/worker.php
@@ -0,0 +1,31 @@
+#!/usr/bin/php
+<?php
+/* worker.php - part of advanced build vichan feature */
+
+require dirname(__FILE__) . '/inc/cli.php';
+require_once 'inc/controller.php';
+
+$config['smart_build'] = false; // Let's disable it, so we can build the page for real
+$config['generation_strategies'] = array('strategy_immediate');
+
+function after_open_board() { global $config;
+ $config['smart_build'] = false;
+ $config['generation_strategies'] = array('strategy_immediate');
+};
+
+echo "Hello world!\n";
+
+$queue = get_queue('generate');
+
+while (true) {
+ $q = $queue->pop(2);
+ foreach ($q as $v) {
+ list($__, $func, $ary, $action) = unserialize($v);
+ echo "Starting to generate $func ".implode(" ", $ary)."... ";
+
+ call_user_func_array($func, $ary);
+
+ echo "done!\n";
+ }
+ if (!$q) usleep(20000); // 0.02s
+}