public function showQueue(X_Threads_Thread_Info $thread) { $queue = $this->getZendQueue($thread->getId()); $received = $queue->receive(25, 0); $messages = array(); foreach ($received as $message) { /* @var $message Zend_Queue_Message */ $messages[] = @unserialize($message->body); } return $messages; }
public function getThreads() { $allStatus = $this->retrieveAllStatus(); $threads = array(); foreach ($allStatus as $status) { list($id, $state, $info) = $status; $thread = new X_Threads_Thread_Info($id); $thread->setStatus($state, $info); $threads[] = $thread; } return $threads; }
/** * Spawn a new thread * * @param X_Threads_Thread_Info $thread */ protected function resume(X_Threads_Thread_Info $thread) { if (!$this->getStarter()->spawn($thread->getId())) { throw new Exception("Thread not started {{$thread->getId()}"); } }
public function __construct($threadId, X_Threads_Manager $manager) { $this->manager = $manager; parent::__construct($threadId); }