Class: ChainedJob::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/chained_job/config.rb

Constant Summary collapse

DEFAULT_ARGUMENTS_BATCH_SIZE =
1_000
DEFAULT_ARGUMENTS_QUEUE_EXPIRATION =

7 days

7 * 24 * 60 * 60

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/chained_job/config.rb', line 23

def initialize
  self.arguments_batch_size = DEFAULT_ARGUMENTS_BATCH_SIZE
  self.arguments_queue_expiration = DEFAULT_ARGUMENTS_QUEUE_EXPIRATION

  self.logger = ::Logger.new(STDOUT)

  self.around_start_chains = ->(_options, &block) { block.call }
  self.around_chain_process = ->(_options, &block) { block.call }
  self.around_array_of_job_arguments = ->(_options, &block) { block.call }
  self.after_worker_finished = ->(_options) {}

  self.debug = true
end

Instance Attribute Details

#after_worker_finishedObject

Returns the value of attribute after_worker_finished.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def after_worker_finished
  @after_worker_finished
end

#arguments_batch_sizeObject

Returns the value of attribute arguments_batch_size.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def arguments_batch_size
  @arguments_batch_size
end

#arguments_queue_expirationObject

Returns the value of attribute arguments_queue_expiration.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def arguments_queue_expiration
  @arguments_queue_expiration
end

#around_array_of_job_argumentsObject

Returns the value of attribute around_array_of_job_arguments.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def around_array_of_job_arguments
  @around_array_of_job_arguments
end

#around_chain_processObject

Returns the value of attribute around_chain_process.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def around_chain_process
  @around_chain_process
end

#around_start_chainsObject

Returns the value of attribute around_start_chains.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def around_start_chains
  @around_start_chains
end

#debugObject

Returns the value of attribute debug.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def debug
  @debug
end

#loggerObject

Returns the value of attribute logger.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def logger
  @logger
end

#redisObject

Returns the value of attribute redis.



10
11
12
# File 'lib/chained_job/config.rb', line 10

def redis
  @redis
end