Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added IronMQ#clearQueue method #7

Merged
merged 1 commit into from

2 participants

@EvanK

Implements a method to clear all messages in a queue.

@thousandsofthem
Collaborator

Thanks!

@thousandsofthem thousandsofthem merged commit 4547200 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2012
  1. @EvanK

    Added IronMQ#clearQueue method

    EvanK authored
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 0 deletions.
  1. +13 −0 IronMQ.class.php
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.