/** * Kick jobs * - server * - tube * - count : number of jobs to kick */ public function kickAction() { $server = $this->_getParam("server"); $tube = $this->_getParam("tube"); $count = $this->_getParam("count", 1); try { // Connect to the server $messageQueue = new Pheanstalk_Pheanstalk($server); $messageQueue->useTube($tube); $messageQueue->kick($count); $response = ""; } catch (Exception $e) { $this->getResponse()->setHttpResponseCode(500); $response = $e->getMessage(); } // Send Json response $this->jsonHelper->sendJson($response); $this->jsonHelper->getResponse()->sendResponse(); }