Skip to content

Commit

Permalink
Merge pull request #3 from WyriHaximus/change-rxwebsocket-client
Browse files Browse the repository at this point in the history
Change to Rx\Websocket client
  • Loading branch information
WyriHaximus committed May 22, 2016
2 parents e6634eb + 6699c26 commit 05453bb
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 138 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
],
"require": {
"php": "^7.0",
"ratchet/pawl": "^0.2.2",
"wyrihaximus/api-client": "dev-master"
"wyrihaximus/api-client": "dev-master",
"rx/websocket": "^0.9.2"
},
"require-dev": {
"phpunit/phpunit": "^5.2.3",
Expand Down
247 changes: 152 additions & 95 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/reddit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
$subReddits = $argv;
array_shift($subReddits);
foreach ($subReddits as $subReddit) {
$client->subscribe($subReddit)->subscribe(new CallbackObserver(function ($event) {
echo 'Channel: ', $event['channel'], PHP_EOL;
echo 'Event: ', $event['event'], PHP_EOL;
echo 'Data: ', $event['data'], PHP_EOL;
$client->channel($subReddit)->subscribe(new CallbackObserver(function ($event) {
echo 'Channel: ', $event->channel, PHP_EOL;
echo 'Event: ', $event->event, PHP_EOL;
echo 'Data: ', $event->data, PHP_EOL;
}));
}

Expand Down

0 comments on commit 05453bb

Please sign in to comment.