diff options
Diffstat (limited to 'lib/presque')
-rw-r--r-- | lib/presque/RestQueueBatchHandler.pm | 58 | ||||
-rw-r--r-- | lib/presque/RestQueueHandler.pm | 2 |
2 files changed, 57 insertions, 3 deletions
diff --git a/lib/presque/RestQueueBatchHandler.pm b/lib/presque/RestQueueBatchHandler.pm index e25d570..281b117 100644 --- a/lib/presque/RestQueueBatchHandler.pm +++ b/lib/presque/RestQueueBatchHandler.pm @@ -157,21 +157,75 @@ __END__ =head1 NAME -presque::RestQueueBatchHandler +presque::RestQueueBatchHandler - insert or fetch jobs in batch =head1 SYNOPSIS # insert a list of jobs - curl -H 'Content-Type: application/json' -X POST "http://localhost:5000/qb/foo" -d '{jobs:["key":"value"], ["key2":"value2"]}' + curl -H 'Content-Type: application/json' -X POST "http://localhost:5000/qb/foo" -d '{jobs:[{"key":"value"}, {"key2":"value2"}]}' # fetch some jobs curl http://localhost:5000/qb/foo =head1 DESCRIPTION +Insert of fetch jobs in batch. + =head1 METHODS =head2 get +=over 4 + +=item path + +/qb/:queue_name + +=item request + +queue_name: [required] name of the queue to use + +=item response + +If the queue is closed: 404 + +=back + =head2 post +=over 4 + +=item path + +/qb/:queue_name + +=item request + +queue_name: [required] name of the queue to use + +Content-Type: application/json + +=item response + +=back + +The batch method doesn't support delayed and uniq. Jobs are array ref under the "jobs" key. + +=back + +=head1 AUTHOR + +franck cuny E<lt>franck@lumberjaph.netE<gt> + +=head1 SEE ALSO + +=head1 LICENSE + +Copyright 2010 by Linkfluence + +L<http://linkfluence.net> + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/lib/presque/RestQueueHandler.pm b/lib/presque/RestQueueHandler.pm index d47751c..54dffab 100644 --- a/lib/presque/RestQueueHandler.pm +++ b/lib/presque/RestQueueHandler.pm @@ -318,7 +318,7 @@ content : JSON object query : delayed, worker_id -delay : after which date (in epoch) this job should be run +delayed : after which date (in epoch) this job should be run uniq : this job is uniq. The value is the string that will be used to determined if the job is uniq |