public function stop()
    {
        $deferred = new Deferred();

        $onStop = $this->onStop;
        $onStop()
            ->then(function () use (&$deferred) {
                $this->ariClient->onClose(function () use (&$deferred) {
                    $this->eventLoop->stop();
                    $deferred->resolve();
                });
                $this->wsClient->close();
            });

        return $deferred->promise();
    }
public function stop()
    {
        $deferred = new Deferred();

        $onStop = $this->onStop;
        $onStop()
            ->then(function () use (&$deferred) {
                $this->ariClient->onClose(function () use (&$deferred) {
                    $this->eventLoop->stop();
                    $deferred->resolve();
                });
                $this->wsClient->close();
            });

        return $deferred->promise();
    }
public function stop ( ) { $ deferred = new Deferred ( ) ; $ onStop = $ this -> onStop ; $ onStop ( ) -> then ( function ( ) use ( & $ deferred ) { $ this -> ariClient -> onClose ( function ( ) use ( & $ deferred ) { $ this -> eventLoop -> stop ( ) ; $ deferred -> resolve ( ) ; } ) ; $ this -> wsClient -> close ( ) ; } ) ; return $ deferred -> promise ( ) ; }
Disconnect and stop the event loop
@return \React\Promise\Promise|\React\Promise\PromiseInterface
Disconnect and stop the event loop