77use ApiClients \Foundation \Factory ;
88use ApiClients \Foundation \Hydrator \CommandBus \Command \HydrateCommand ;
99use ApiClients \Foundation \Transport \CommandBus \Command \SimpleRequestCommand ;
10+ use function ApiClients \Tools \Rx \observableFromArray ;
1011use Psr \Http \Message \ResponseInterface ;
1112use React \EventLoop \LoopInterface ;
1213use React \Promise \PromiseInterface ;
@@ -89,7 +90,7 @@ public function queues(int $interval = null): ObservableInterface
8990 return Promise::toObservable ($ this ->client ->handle (
9091 new SimpleRequestCommand ('queues ' )
9192 ))->flatMap (function (ResponseInterface $ response ) {
92- return Observable:: fromArray ($ response ->getBody ()->getJson ());
93+ return observableFromArray ($ response ->getBody ()->getJson ());
9394 })->flatMap (function ($ queue ) {
9495 return Promise::toObservable ($ this ->client ->handle (
9596 new HydrateCommand ('Queue ' , $ queue )
@@ -111,7 +112,7 @@ public function connections(): ObservableInterface
111112 return Promise::toObservable ($ this ->client ->handle (
112113 new SimpleRequestCommand ('connections ' )
113114 ))->flatMap (function (ResponseInterface $ response ) {
114- return Observable:: fromArray ($ response ->getBody ()->getJson ());
115+ return observableFromArray ($ response ->getBody ()->getJson ());
115116 })->flatMap (function ($ connection ) {
116117 return Promise::toObservable ($ this ->client ->handle (
117118 new HydrateCommand ('Connection ' , $ connection )
0 commit comments