Skip to content

Added IronMQ#clearQueue method #7

Merged
merged 1 commit into from Oct 15, 2012
+13 −0
View
13 IronMQ.class.php
@@ -190,6 +190,19 @@ public function getQueue($queue_name) {
}
/**
+ * 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
*
* Examples:
Something went wrong with that request. Please try again.