diff --git a/src/Client.php b/src/Client.php index d95a3d3..531e4de 100644 --- a/src/Client.php +++ b/src/Client.php @@ -2,7 +2,6 @@ namespace Rx\Thruway; -use Rx\Observer\CallbackObserver; use Rx\Scheduler; use Rx\Thruway\Subject\SessionReplaySubject; use Rx\Thruway\Subject\WebSocketSubject; diff --git a/src/Subject/WebSocketSubject.php b/src/Subject/WebSocketSubject.php index 1bda51c..58a2c53 100644 --- a/src/Subject/WebSocketSubject.php +++ b/src/Subject/WebSocketSubject.php @@ -27,7 +27,7 @@ public function __construct(string $url, array $protocols = [], Subject $openObs $this->openObserver = $openObserver; $this->closeObserver = $closeObserver; $this->serializer = new JsonSerializer(); - $this->loop = new AsyncInteropLoop(); + $this->loop = \EventLoop\getLoop(); $this->output = new Subject(); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 063f2ba..6b1e21b 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -25,4 +25,6 @@ * The default scheduler is the EventLoopScheduler, which is asynchronous. * For testing we need to block at `subscribe`, so we need to switch the default to the ImmediateScheduler. */ -\Rx\Scheduler::setDefault(new \Rx\Scheduler\ImmediateScheduler()); \ No newline at end of file +\Rx\Scheduler::setDefaultFactory(function () { + return new \Rx\Scheduler\ImmediateScheduler(); +}); \ No newline at end of file