Class: MailRoom::Arbitration::Redis::Options

Inherits:
Struct
  • Object
show all
Defined in:
lib/mail_room/arbitration/redis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mailbox) ⇒ Options

Returns a new instance of Options.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/mail_room/arbitration/redis.rb', line 7

def initialize(mailbox)
  redis_url = mailbox.arbitration_options[:redis_url] || "redis://localhost:6379"
  namespace = mailbox.arbitration_options[:namespace]
  sentinels = mailbox.arbitration_options[:sentinels]
  sentinel_username = mailbox.arbitration_options[:sentinel_username]
  sentinel_password = mailbox.arbitration_options[:sentinel_password]

  if namespace
    warn <<~MSG
      Redis namespaces are deprecated. This option will be ignored in future versions.
      See https://github.com/sidekiq/sidekiq/issues/2586 for more details."
    MSG
  end

  super(redis_url, namespace, sentinels, sentinel_username, sentinel_password)
end

Instance Attribute Details

#namespaceObject

Returns the value of attribute namespace

Returns:

  • (Object)

    the current value of namespace



6
7
8
# File 'lib/mail_room/arbitration/redis.rb', line 6

def namespace
  @namespace
end

#redis_urlObject

Returns the value of attribute redis_url

Returns:

  • (Object)

    the current value of redis_url



6
7
8
# File 'lib/mail_room/arbitration/redis.rb', line 6

def redis_url
  @redis_url
end

#sentinel_passwordObject

Returns the value of attribute sentinel_password

Returns:

  • (Object)

    the current value of sentinel_password



6
7
8
# File 'lib/mail_room/arbitration/redis.rb', line 6

def sentinel_password
  @sentinel_password
end

#sentinel_usernameObject

Returns the value of attribute sentinel_username

Returns:

  • (Object)

    the current value of sentinel_username



6
7
8
# File 'lib/mail_room/arbitration/redis.rb', line 6

def sentinel_username
  @sentinel_username
end

#sentinelsObject

Returns the value of attribute sentinels

Returns:

  • (Object)

    the current value of sentinels



6
7
8
# File 'lib/mail_room/arbitration/redis.rb', line 6

def sentinels
  @sentinels
end