Predis\PubSub\Consumer::checkCapabilities PHP Метод

checkCapabilities() приватный Метод

Checks if the client instance satisfies the required conditions needed to initialize a PUB/SUB consumer.
private checkCapabilities ( Predis\ClientInterface $client )
$client Predis\ClientInterface Client instance used by the consumer.
    private function checkCapabilities(ClientInterface $client)
    {
        if ($client->getConnection() instanceof AggregateConnectionInterface) {
            throw new NotSupportedException('Cannot initialize a PUB/SUB consumer over aggregate connections.');
        }
        $commands = array('publish', 'subscribe', 'unsubscribe', 'psubscribe', 'punsubscribe');
        if ($client->getCommandFactory()->supportsCommands($commands) === false) {
            throw new NotSupportedException('PUB/SUB commands are not supported by the current command factory.');
        }
    }