module Attention::Connection

Provides a namespaced Redis connection

Public Class Methods

new() click to toggle source

Creates a Redis connection @return [Redis] A namespaced Redis connection with configuration

from Attention.options
# File lib/attention/connection.rb, line 10
def self.new
  connection = Redis.new url: Attention.options[:redis_url],
      connect_timeout: Attention.options[:timeout],
      timeout: Attention.options[:timeout]

  Redis::Namespace.new Attention.options[:namespace], redis: connection
end