Skip to content

Commit 6a37b6a

Browse files
committed
Updated to api-clients/rx 2.1 with observableFromArray
1 parent a3f06d6 commit 6a37b6a

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "^7.0",
14-
"api-clients/client-services": "^1.0",
14+
"api-clients/client-services": "^1.1",
1515
"api-clients/foundation": "dev-master",
1616
"api-clients/middleware-json": "^1.0",
1717
"api-clients/middleware-user-agent": "^1.0",

composer.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AsyncClient.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use ApiClients\Foundation\Factory;
88
use ApiClients\Foundation\Hydrator\CommandBus\Command\HydrateCommand;
99
use ApiClients\Foundation\Transport\CommandBus\Command\SimpleRequestCommand;
10+
use function ApiClients\Tools\Rx\observableFromArray;
1011
use Psr\Http\Message\ResponseInterface;
1112
use React\EventLoop\LoopInterface;
1213
use 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

Comments
 (0)