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.');
}
}