Class: NatsWorker::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/nats_worker/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/nats_worker/configuration.rb', line 10

def initialize
  @servers               = ENV.fetch("NATS_URL", "nats://127.0.0.1:4222").split(",")
  @nats_options          = {}
  @logger                = Logger.new($stdout)
  @logger.level          = Logger::INFO
  @default_fetch_size    = 10
  @default_fetch_timeout = 5
  @default_threads       = 1
  @default_ack_wait      = 30
  @shutdown_timeout      = 25
end

Instance Attribute Details

#default_ack_waitObject

Returns the value of attribute default_ack_wait.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def default_ack_wait
  @default_ack_wait
end

#default_fetch_sizeObject

Returns the value of attribute default_fetch_size.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def default_fetch_size
  @default_fetch_size
end

#default_fetch_timeoutObject

Returns the value of attribute default_fetch_timeout.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def default_fetch_timeout
  @default_fetch_timeout
end

#default_threadsObject

Returns the value of attribute default_threads.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def default_threads
  @default_threads
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def logger
  @logger
end

#nats_optionsObject

Returns the value of attribute nats_options.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def nats_options
  @nats_options
end

#serversObject

Returns the value of attribute servers.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def servers
  @servers
end

#shutdown_timeoutObject

Returns the value of attribute shutdown_timeout.



5
6
7
# File 'lib/nats_worker/configuration.rb', line 5

def shutdown_timeout
  @shutdown_timeout
end