Skip to content

Commit e17e0e8

Browse files
committed
Use setAsyncScheduler from api-clients/rx instead of setting it ourselfs
1 parent 8dc0512 commit e17e0e8

File tree

3 files changed

+33
-37
lines changed

3 files changed

+33
-37
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"api-clients/middleware-token-authorization": "^3.0",
2222
"api-clients/middleware-user-agent": "^2.0",
2323
"api-clients/pusher": "^1.0",
24-
"api-clients/rx": "^2.0",
24+
"api-clients/rx": "^2.2",
2525
"api-clients/rx-operators": "^2.0",
2626
"api-clients/transport": "^3.0"
2727
},

composer.lock

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

src/AsyncClient.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use React\Promise\PromiseInterface;
1313
use Rx\ObservableInterface;
1414
use Rx\React\Promise;
15-
use Rx\Scheduler;
15+
use function ApiClients\Tools\Rx\setAsyncScheduler;
1616
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
1717

1818
final class AsyncClient implements AsyncClientInterface
@@ -43,12 +43,7 @@ public static function create(
4343
string $token = '',
4444
array $options = []
4545
): self {
46-
try {
47-
Scheduler::setAsyncFactory(function () use ($loop) {
48-
return new Scheduler\EventLoopScheduler($loop);
49-
});
50-
} catch (\Throwable $t) {
51-
}
46+
setAsyncScheduler($loop);
5247

5348
$options = ApiSettings::getOptions($token, 'Async', $options);
5449
$client = Factory::create($loop, $options);

0 commit comments

Comments
 (0)