Example #1
0
 /**
  * @inheritdoc
  */
 public function write($data, $length = null)
 {
     if (!is_null($this->dispatcher) && $this->dispatcher->hasListeners(BeanstalkEvents::STREAM_WRITE)) {
         $this->dispatcher->dispatch(BeanstalkEvents::STREAM_WRITE, new StreamWriteEvent(is_null($length) ? $data : substr($data, 0, $length), $this->getTimeStamp()));
     }
     return parent::write($data, $length);
 }
 /**
  * @param $data
  */
 public function writeReponse($data)
 {
     parent::write($data);
     parent::flush();
     parent::rewind();
 }