Esempio n. 1
0
 private function become_intern($request_message)
 {
     $intern = new Prefork_Intern($this);
     $pid = $this->fork_process();
     if ($pid === 0) {
         // Interns only past this point
         event_base_loopbreak($this->event_base);
         event_base_reinit($this->event_base);
         foreach ($this->events as $i => $event) {
             event_del($event);
             event_free($event);
             unset($this->events[$i]);
         }
         event_base_free($this->event_base);
         $intern->start_request($request_message);
         $this->intern = $intern;
         return true;
     }
     $this->intern_pid = $pid;
     if (!$this->single_interns) {
         $this->make_offer();
     }
     return false;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function reInit()
 {
     event_base_reinit($this->base);
 }
 /**
  * called after fork in the parent instance.
  * This gives the ability to continue the loop
  */
 public function afterForkParent()
 {
     event_base_reinit($this->eventBase);
 }