8000 Publish/subscribe (Segmentation fault) · Issue #4 · phpredis/phpredis · GitHub
[go: up one dir, main page]

Skip to content
Publish/subscribe (Segmentation fault) #4
Closed
@talexander

Description

@talexander

This small script crache php.

function f($redis, $chan, $msg) {
echo "Handle message " . $msg . ' for chanel ' . $chan;
}

$r = new Redis();
if($r->connect('127.0.0.1', 6379)) {
echo 'Sleepping' . PHP_EOL;
sleep(5);

$chanel = 'chanel_'  . rand(1, 10);
echo 'Subscribe  to chanel ' . $chanel . PHP_EOL;
$r->subscribe(array($chanel), 'f');

/* for($i = 0; $i < 10; $i++) {
$r->publish('chanel_' . $i, 'test msg ' . rand(1, 10));
}*/

/*
for($i = 1; $i < 100; $i++) {
    echo $i . PHP_EOL;
    usleep(100000);
}
*/

} else {
echo "Can`t connect to redis." . PHP_EOL;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0