<commit_before><?php

use ApiClients\Client\Pusher\Event;
use React\EventLoop\Factory;
use Rx\Observer\CallbackObserver;
use ApiClients\Client\Pusher\AsyncClient;

require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor/autoload.php';

$loop = Factory::create();

/**
 * The App ID isn't a secret and comes from the bitstamp docs:
 * @link https://www.bitstamp.net/websocket/
 */
$client = new AsyncClient($loop, 'de504dc5763aeef9ff52');

$channelitems = array('live_trades','live_trades_xrpusd');
foreach ($channelitems as $channelitem) {
    $client->channel($channelitem)->subscribe(new CallbackObserver(function (Event $event) {
        echo 'Channel: '. $event->getChannel(). PHP_EOL;
        echo 'Event: '. $event->getEvent(). PHP_EOL;
        echo 'Data: '. print_r($event->getData(),1). PHP_EOL;
    }));
}

$loop->run();
<commit_msg>Updated bitstamp to RxPHP 2.0<commit_after><?php

use ApiClients\Client\Pusher\Event;
use React\EventLoop\Factory;
use Rx\Observer\CallbackObserver;
use ApiClients\Client\Pusher\AsyncClient;

require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor/autoload.php';

$loop = Factory::create();

/**
 * The App ID isn't a secret and comes from the bitstamp docs:
 * @link https://www.bitstamp.net/websocket/
 */
$client = AsyncClient::create($loop, 'de504dc5763aeef9ff52');

$channelitems = array('live_trades','live_trades_xrpusd');
foreach ($channelitems as $channelitem) {
    $client->channel($channelitem)->subscribe(function (Event $event) {
        echo 'Channel: '. $event->getChannel(). PHP_EOL;
        echo 'Event: '. $event->getEvent(). PHP_EOL;
        echo 'Data: '. print_r($event->getData(),1). PHP_EOL;
    });
}

$loop->run();

{'fraction_non_alphanumeric': 0.1631079478054567, 'fraction_numerical': 0.014234875444839857, 'mean_word_length': 4.6610738255033555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4709746', 'n_tokens_mistral': 588, 'n_tokens_neox': 578, 'n_words': 114}