simple example of a task run at shutdown
authorChuck Hagenbuch <chuck@horde.org>
Fri, 12 Jun 2009 22:23:25 +0000 (18:23 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 13 Jun 2009 03:42:07 +0000 (23:42 -0400)
framework/Queue/examples/Horde/Queue/shutdown_runner.php [new file with mode: 0644]

diff --git a/framework/Queue/examples/Horde/Queue/shutdown_runner.php b/framework/Queue/examples/Horde/Queue/shutdown_runner.php
new file mode 100644 (file)
index 0000000..385e76f
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+set_include_path(get_include_path() . ':' . dirname(__FILE__) . '/../../../lib');
+include 'Horde/Autoloader.php';
+
+class TestTask extends Horde_Queue_Task_Base {
+    public function run()
+    {
+        echo "executing\n";
+    }
+}
+
+$qs = new Horde_Queue_Storage_RequestOnly();
+$qr = new Horde_Queue_Runner_RequestShutdown($qs);
+
+$qs->add(new TestTask());
+
+echo "exiting\n";
+exit(0);