about summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-05-15 17:41:09 +0200
committerfranck cuny <franck@lumberjaph.net>2010-05-15 17:41:09 +0200
commit80e1cf6515f5ad348d55c8359e1f8aeb7500cb79 (patch)
treecfa4ad284a88bd55b3690e8843c2d85201ba6ed5
parentclean POD, move spec to appropriate class (diff)
downloadpresque-80e1cf6515f5ad348d55c8359e1f8aeb7500cb79.tar.gz
spec for control handler
-rw-r--r--lib/presque/ControlHandler.pm57
1 files changed, 56 insertions, 1 deletions
diff --git a/lib/presque/ControlHandler.pm b/lib/presque/ControlHandler.pm
index 7ef56e5..ccfc663 100644
--- a/lib/presque/ControlHandler.pm
+++ b/lib/presque/ControlHandler.pm
@@ -66,12 +66,67 @@ __END__
 
 =head1 NAME
 
-presque::ControlHandler - a redis based message queue
+presque::ControlHandler
+
+=head1 SYNOPSIS
+
+    # stop a queue
+    curl -X POST -H 'Content-Type: application/json' -d '{"status":"stop"}' http://localhost:5000/control/queuename
+
+    # start a queue
+    curl -X POST -H 'Content-Type: application/json' -d '{"status":"start"}' http://localhost:5000/control/queuename
+
+    # fetch the status of a queue
+    curl http://localhost:5000/control/queuename
 
 =head1 DESCRIPTION
 
+By default, when a queue is created, the status is set to 'open'. When a queue is set to 'stop', no job will be fetched from the queue.
+
 =head1 METHODS
 
+=head2 GET
+
+=over 4
+
+=item path
+
+/control/queuename
+
+=item request
+
+=item response
+
+content-type : application/json
+
+code : 200
+
+content : {"status":"0","queue":"foo"}
+
+=back
+
+=head2 POST
+
+=over 4
+
+=item path
+
+/control/queuename
+
+=item request
+
+content-type : application/json
+
+content : {"status":"stop"}
+
+=item response
+
+content-type : application/json
+
+content : {"response":"updated","queue":"foo"}
+
+=back
+
 =head1 AUTHOR
 
 franck cuny E<lt>franck@lumberjaph.netE<gt>