Class: Minigun::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/minigun/runner.rb

Constant Summary collapse

ACCUMULATOR_MAX_SINGLE_QUEUE =

10_000

2000
ACCUMULATOR_MAX_ALL_QUEUES =

3

ACCUMULATOR_MAX_SINGLE_QUEUE * 2
ACCUMULATOR_CHECK_INTERVAL =
100
CONSUMER_THREAD_BATCH_SIZE =

1000

200
CONSUMER_QUERY_BATCH_SIZE =
200
DEFAULT_MAX_RETRIES =
10
TIME_ZONE =
'Asia/Tokyo'
LOCALE =
:en
MODEL_INCLUDES =
{}.freeze
MODELS_TRANSACTIONAL =
%w[ Foo
Bar ].freeze

Instance Method Summary collapse

Constructor Details

#initialize(models: nil, start_time: nil, end_time: nil, max_processes: nil, max_threads: nil, max_retries: nil) ⇒ Runner

Returns a new instance of Runner.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/minigun/runner.rb', line 17

def initialize(models: nil,
               start_time: nil,
               end_time: nil,
               max_processes: nil,
               max_threads: nil,
               max_retries: nil)
  @raw_models = Array(models) if models
  @start_time = start_time
  @end_time   = end_time
  time_range
  @max_processes = max_processes
  @max_threads = max_threads
  @max_retries = max_retries || DEFAULT_MAX_RETRIES
  @produced_count = 0
  @accumulated_count = 0
end