Class: RailsTransactionalOutbox::Configuration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#database_connection_providerObject

Returns the value of attribute database_connection_provider.



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

def database_connection_provider
  @database_connection_provider
end

#datadog_statsd_clientObject

Returns the value of attribute datadog_statsd_client.



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

def datadog_statsd_client
  @datadog_statsd_client
end

#error_handlerObject



15
16
17
# File 'lib/rails_transactional_outbox/configuration.rb', line 15

def error_handler
  @error_handler || RailsTransactionalOutbox::ErrorHandlers::NullErrorHandler
end

#high_priority_sidekiq_queueObject



69
70
71
72
73
# File 'lib/rails_transactional_outbox/configuration.rb', line 69

def high_priority_sidekiq_queue
  return @high_priority_sidekiq_queue if defined?(@high_priority_sidekiq_queue)

  self.class.high_priority_sidekiq_queue
end

#lock_clientObject



51
52
53
# File 'lib/rails_transactional_outbox/configuration.rb', line 51

def lock_client
  @lock_client || RailsTransactionalOutbox::NullLockClient
end

#lock_expiry_timeObject



55
56
57
# File 'lib/rails_transactional_outbox/configuration.rb', line 55

def lock_expiry_time
  @lock_expiry_time || 10_000
end

#loggerObject

Returns the value of attribute logger.



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

def logger
  @logger
end

#outbox_batch_sizeObject



27
28
29
# File 'lib/rails_transactional_outbox/configuration.rb', line 27

def outbox_batch_size
  @outbox_batch_size || 100
end

#outbox_entries_processorObject



39
40
41
# File 'lib/rails_transactional_outbox/configuration.rb', line 39

def outbox_entries_processor
  @outbox_entries_processor ||= RailsTransactionalOutbox::OutboxEntriesProcessors::NonOrderedProcessor.new
end

#outbox_entry_causality_key_resolverObject



59
60
61
# File 'lib/rails_transactional_outbox/configuration.rb', line 59

def outbox_entry_causality_key_resolver
  @outbox_entry_causality_key_resolver || ->(_model) {}
end

#outbox_modelObject

Returns the value of attribute outbox_model.



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

def outbox_model
  @outbox_model
end

#raise_not_found_model_errorObject Also known as: raise_not_found_model_error?



43
44
45
46
47
# File 'lib/rails_transactional_outbox/configuration.rb', line 43

def raise_not_found_model_error
  return @raise_not_found_model_error if defined?(@raise_not_found_model_error)

  true
end

#transaction_providerObject

Returns the value of attribute transaction_provider.



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

def transaction_provider
  @transaction_provider
end

#transactional_outbox_worker_idle_delay_multiplierObject



23
24
25
# File 'lib/rails_transactional_outbox/configuration.rb', line 23

def transactional_outbox_worker_idle_delay_multiplier
  @transactional_outbox_worker_idle_delay_multiplier || 10
end

#transactional_outbox_worker_sleep_secondsObject



19
20
21
# File 'lib/rails_transactional_outbox/configuration.rb', line 19

def transactional_outbox_worker_sleep_seconds
  @transactional_outbox_worker_sleep_seconds || 0.5
end

#unprocessed_causality_keys_limitObject



63
64
65
66
67
# File 'lib/rails_transactional_outbox/configuration.rb', line 63

def unprocessed_causality_keys_limit
  return @unprocessed_causality_keys_limit.to_i if defined?(@unprocessed_causality_keys_limit)

  10_000
end

Class Method Details

.high_priority_sidekiq_queueObject



11
12
13
# File 'lib/rails_transactional_outbox/configuration.rb', line 11

def self.high_priority_sidekiq_queue
  :rails_transactional_outbox_high_priority
end

Instance Method Details

#add_record_processor(record_processor) ⇒ Object



35
36
37
# File 'lib/rails_transactional_outbox/configuration.rb', line 35

def add_record_processor(record_processor)
  record_processors << record_processor
end

#record_processorsObject



31
32
33
# File 'lib/rails_transactional_outbox/configuration.rb', line 31

def record_processors
  @record_processors ||= [RailsTransactionalOutbox::RecordProcessors::ActiveRecordProcessor.new]
end