-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
...like in https://github.com/xp-forge/websockets:
use io\redis\RedisProtocol;
use websocket\{Listener, Listeners};
class Example extends Listeners {
public function serve($listeners) {
$dsn= ...;
$queue= ...;
// Subscribe to the Redis queue and handle
$protocol= new RedisProtocol($dsn);
$protocol->command('SUBSCRIBE', $queue);
$listeners->add($protocol->socket(), function($protocol) {
$message= $protocol->receive();
// ...shortened for brevity...
});
}
return function($conn, $payload) { /* ... */ };
}This would make it possible to broadcast messages as seen here: https://github.com/thekid/crews/blob/main/src/main/php/de/thekid/crews/Feed.php
Metadata
Metadata
Assignees
Labels
No labels