예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 /**
  * 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()}");
     }
 }
예제 #4
0
 public function __construct($threadId, X_Threads_Manager $manager)
 {
     $this->manager = $manager;
     parent::__construct($threadId);
 }