7
7
use ApiClients \Foundation \Factory ;
8
8
use ApiClients \Foundation \Hydrator \CommandBus \Command \HydrateCommand ;
9
9
use ApiClients \Foundation \Transport \CommandBus \Command \SimpleRequestCommand ;
10
+ use function ApiClients \Tools \Rx \observableFromArray ;
10
11
use Psr \Http \Message \ResponseInterface ;
11
12
use React \EventLoop \LoopInterface ;
12
13
use React \Promise \PromiseInterface ;
@@ -89,7 +90,7 @@ public function queues(int $interval = null): ObservableInterface
89
90
return Promise::toObservable ($ this ->client ->handle (
90
91
new SimpleRequestCommand ('queues ' )
91
92
))->flatMap (function (ResponseInterface $ response ) {
92
- return Observable:: fromArray ($ response ->getBody ()->getJson ());
93
+ return observableFromArray ($ response ->getBody ()->getJson ());
93
94
})->flatMap (function ($ queue ) {
94
95
return Promise::toObservable ($ this ->client ->handle (
95
96
new HydrateCommand ('Queue ' , $ queue )
@@ -111,7 +112,7 @@ public function connections(): ObservableInterface
111
112
return Promise::toObservable ($ this ->client ->handle (
112
113
new SimpleRequestCommand ('connections ' )
113
114
))->flatMap (function (ResponseInterface $ response ) {
114
- return Observable:: fromArray ($ response ->getBody ()->getJson ());
115
+ return observableFromArray ($ response ->getBody ()->getJson ());
115
116
})->flatMap (function ($ connection ) {
116
117
return Promise::toObservable ($ this ->client ->handle (
117
118
new HydrateCommand ('Connection ' , $ connection )
0 commit comments