Skip to content
Browse files

Added 'delay' parameter for releaseMessage()'

  • Loading branch information...
1 parent e2e6b71 commit 18bfd6ae3f17c73c5f8e82971c5402136e552a38 @thousandsofthem thousandsofthem committed Mar 12, 2013
Showing with 9 additions and 4 deletions.
  1. +9 −4 IronMQ.class.php
  2. BIN iron_mq.phar
View
13 IronMQ.class.php
@@ -6,7 +6,7 @@
* @link https://github.com/iron-io/iron_mq_php
* @link http://www.iron.io/products/mq
* @link http://dev.iron.io/
- * @version 1.4.3
+ * @version 1.4.4
* @package IronMQPHP
* @copyright Feel free to copy, steal, take credit for, or whatever you feel like doing with this code. ;)
*/
@@ -117,7 +117,7 @@ public function asArray() {
class IronMQ extends IronCore {
- protected $client_version = '1.4.3';
+ protected $client_version = '1.4.4';
protected $client_name = 'iron_mq_php';
protected $product_name = 'iron_mq';
protected $default_values = array(
@@ -394,13 +394,18 @@ public function touchMessage($queue_name, $message_id) {
*
* @param string $queue_name
* @param string $message_id
+ * @param int $delay The item will not be available on the queue until this many seconds have passed. Default is 0 seconds. Maximum is 604,800 seconds (7 days).
* @return mixed
*/
- public function releaseMessage($queue_name, $message_id) {
+ public function releaseMessage($queue_name, $message_id, $delay = 0) {
$this->setJsonHeaders();
$queue = rawurlencode($queue_name);
+ $params = array();
+ if ($delay !== 0) {
+ $params['delay'] = (int) $delay;
+ }
$url = "projects/{$this->project_id}/queues/$queue/messages/{$message_id}/release";
- return self::json_decode($this->apiCall(self::POST, $url));
+ return self::json_decode($this->apiCall(self::POST, $url, $params));
}
/**
View
BIN iron_mq.phar
Binary file not shown.

0 comments on commit 18bfd6a

Please sign in to comment.
Something went wrong with that request. Please try again.