public function resolve(Command $command, InputInterface $input, OutputInterface $output, array $args)
{
$options = array('scheme' => 'tcp', 'host' => $args['host'], 'port' => $args['port']);
$password = Resque::getConfig('redis.password', Resque\Redis::DEFAULT_PASSWORD);
if ($password !== null && $password !== false && trim($password) !== '') {
$options['password'] = $password;
}
$redis = new \Predis\Client($options);
$namespace = Resque::getConfig('redis.namespace', Resque\Redis::DEFAULT_NS);
if (substr($namespace, -1) !== ':') {
$namespace .= ':';
}
$key = $this->replacePlaceholders($args['key']);
if (strpos($key, $namespace) !== 0) {
$key = $namespace . $key;
}
return new RedisHandler($redis, $key);
}