protected function waitFor(StreamingClient $client) { $this->assertTrue($client->isBusy()); while ($client->isBusy()) { $this->loop->tick(); } }
/** * @param $name * @param $arguments * @return AnonymousObservable */ public function __call($name, array $arguments = []) { $promise = $this->client->__call($name, $arguments); return Observable::defer(function () use($promise) { $subject = new AsyncSubject(); $promise->then(function ($data) use($subject) { $subject->onNext($data); $subject->onCompleted(); }, [$subject, "onError"]); return $subject; }); }