Permalink
Browse files

Added IronMQ#clearQueue method

  • Loading branch information...
1 parent 689732f commit d894a6768200d219c9d70271da6c42d5e32c489a @EvanK committed Oct 15, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 IronMQ.class.php
View
@@ -189,6 +189,19 @@ public function getQueue($queue_name) {
return self::json_decode($this->apiCall(self::GET, $url));
}
+ /**
+ * Clear all messages from queue.
+ *
+ * @param string $queue_name
+ * @return mixed
+ */
+ public function clearQueue($queue_name) {
+ $queue = rawurlencode($queue_name);
+ $url = "projects/{$this->project_id}/queues/$queue/clear";
+ $this->setJsonHeaders();
+ return self::json_decode($this->apiCall(self::POST, $url));
+ }
+
/**
* Push a message on the queue
*

0 comments on commit d894a67

Please sign in to comment.