public function __construct(EventLoopInterface $loop) { $this->loop = $loop; $this->loop->addChild([$this, 'handleExit']); }