onFinish() public method

Called when the request finished
public onFinish ( ) : void
return void
Example #1
0
 /**
  * @TODO DESCR
  * @return void
  */
 public function onFinish()
 {
     if ($this->onFinishedCalled) {
         return;
     }
     $this->onFinishedCalled = true;
     $this->appInstance->unsubscribe('c2s:' . $this->id, [$this, 'c2s']);
     $this->appInstance->unsubscribe('poll:' . $this->id, [$this, 'poll']);
     if (isset($this->route)) {
         $this->route->onFinish();
     }
     $this->onWrite->reset();
     $this->route = null;
     Timer::remove($this->finishTimer);
     $this->appInstance->endSession($this);
 }