<commit_before>--TEST--
swoole_redis_coro: redis psubscribe 2
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';

go(function () {
    $redis = new Co\Redis();
    $redis->connect(REDIS_SERVER_HOST, REDIS_SERVER_PORT);

    $redis2 = new Co\redis;
    $redis2->connect(REDIS_SERVER_HOST, REDIS_SERVER_PORT);

    for ($i = 0; $i < MAX_REQUESTS; $i++) {
        $channel = 'channel' . $i;
        $val = $redis->psubscribe([$channel . '*']);
        $channel .= 'test';
        assert($val[0][0] == 'psubscribe' && $val[0][1] == $channel . '*');

        go(function () use ($channel, $redis2) {
            $ret = $redis2->publish($channel, 'test' . $channel);
            assert($ret);
        });

        $val = $redis->recv();
        assert($val and $val[0] == 'pmessage');
    }

    $redis->close();
});

?>
--EXPECT--<commit_msg>fix test<commit_after>--TEST--
swoole_redis_coro: redis psubscribe 2
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';

go(function () {
    $redis = new Co\Redis();
    $redis->connect(REDIS_SERVER_HOST, REDIS_SERVER_PORT);

    $redis2 = new Co\redis;
    $redis2->connect(REDIS_SERVER_HOST, REDIS_SERVER_PORT);

    for ($i = 0; $i < MAX_REQUESTS; $i++) {
        $channel = 'channel' . $i;
        $val = $redis->psubscribe([$channel . '*']);
        assert($val[0][0] == 'psubscribe' && $val[0][1] == $channel . '*');
        $channel .= 'test';

        go(function () use ($channel, $redis2) {
            $ret = $redis2->publish($channel, 'test' . $channel);
            assert($ret);
        });

        $val = $redis->recv();
        assert($val and $val[0] == 'pmessage');
    }

    $redis->close();
});

?>
--EXPECT--
{'fraction_non_alphanumeric': 0.22100054975261132, 'fraction_numerical': 0.012094557449147883, 'mean_word_length': 2.5408560311284045, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3421539', 'n_tokens_mistral': 684, 'n_tokens_neox': 663, 'n_words': 120}