Skip to content

Commit 05453bb

Browse files
committed
Merge pull request #3 from WyriHaximus/change-rxwebsocket-client
Change to Rx\Websocket client
2 parents e6634eb + 6699c26 commit 05453bb

File tree

4 files changed

+213
-138
lines changed

4 files changed

+213
-138
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
],
1010
"require": {
1111
"php": "^7.0",
12-
"ratchet/pawl": "^0.2.2",
13-
"wyrihaximus/api-client": "dev-master"
12+
"wyrihaximus/api-client": "dev-master",
13+
"rx/websocket": "^0.9.2"
1414
},
1515
"require-dev": {
1616
"phpunit/phpunit": "^5.2.3",

composer.lock

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

examples/reddit.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
$subReddits = $argv;
1919
array_shift($subReddits);
2020
foreach ($subReddits as $subReddit) {
21-
$client->subscribe($subReddit)->subscribe(new CallbackObserver(function ($event) {
22-
echo 'Channel: ', $event['channel'], PHP_EOL;
23-
echo 'Event: ', $event['event'], PHP_EOL;
24-
echo 'Data: ', $event['data'], PHP_EOL;
21+
$client->channel($subReddit)->subscribe(new CallbackObserver(function ($event) {
22+
echo 'Channel: ', $event->channel, PHP_EOL;
23+
echo 'Event: ', $event->event, PHP_EOL;
24+
echo 'Data: ', $event->data, PHP_EOL;
2525
}));
2626
}
2727

0 commit comments

Comments
 (0)