From 8c47537ab8b572c13f93dc88cae38ca890416666 Mon Sep 17 00:00:00 2001
From: kotnik <kotnik@drupal.rs>
Date: Fri, 10 Aug 2012 16:09:38 +0200
Subject: [PATCH] Added documentation.

A README file with the description on how to use Advanced Queue module.
---
 README                | 42 ++++++++++++++++++++++++++++++++++++++++++
 advancedqueue.install |  2 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 README

diff --git a/README b/README
new file mode 100644
index 0000000..cdb84a2
--- /dev/null
+++ b/README
@@ -0,0 +1,42 @@
+Advanced Queue
+==============
+
+An extended queuing module fully backward compatible with and a drop-in
+replacement of DrupalQueue.
+
+Supports:
+
+* A Drush-based execution engine for queued job, supporting executing multiple
+  queues at the same time and timeouts.
+* Human readable, translatable names for queued items.
+* Tags for queued items.
+* Status of queued items (new, being processed, succeeded, failed), and result
+  payload.
+* Full Views integration.
+
+Sponsored by Publicis Modem. Developed and sponsored by Commerce Guys.
+
+In order to use Drush based execution engine your module must provide
+hook_advanced_queue_info() in which a processing callback (worker) must be
+declared. This callback will receive the item being processed and process it. In
+case the processing fails, an exception should be thrown. Callback should return
+an array with status and result, although it is optional.
+
+For example:
+
+    function hook_advanced_queue_info() {
+      return array(
+        "turbine" => array(
+          'worker callback' => 'example_queue_callback',
+        )
+      );
+    }
+
+function example_queue_callback($item) {
+  if (rand(1,100) <= 50) {
+    return array(0 => 1, 1 => 'Lottery win.')
+  } else {
+    throw new Exception('Lottery fail.');
+  }
+  }
+}
diff --git a/advancedqueue.install b/advancedqueue.install
index ae002f2..f438161 100644
--- a/advancedqueue.install
+++ b/advancedqueue.install
@@ -65,7 +65,7 @@ function advancedqueue_schema() {
         'not null' => FALSE,
         'size' => 'big',
         'serialize' => TRUE,
-        'description' => 'The arbitrary result for the item, only significant if {redisqueue}.status <> 0',
+        'description' => 'The arbitrary result for the item, only significant if {advancedqueue}.status <> 0',
       ),
       'expire' => array(
         'type' => 'int',
-- 
1.7.11.4

