Class: Dionysus::Consumer::Config
- Inherits:
-
Object
- Object
- Dionysus::Consumer::Config
- Defined in:
- lib/dionysus/consumer/config.rb
Instance Attribute Summary collapse
- #consumer_base_class ⇒ Object
- #event_bus ⇒ Object
- #instrumenter ⇒ Object
- #message_filters ⇒ Object
- #model_factory ⇒ Object
- #processing_mutex_method_name ⇒ Object
- #processing_mutex_provider ⇒ Object
-
#registry ⇒ Object
Returns the value of attribute registry.
- #resolve_synced_data_hash_proc ⇒ Object
- #retry_provider ⇒ Object
- #sidekiq_queue ⇒ Object
- #soft_delete_strategy ⇒ Object
- #soft_deleted_at_timestamp_attribute ⇒ Object
- #synced_created_at_timestamp_attribute ⇒ Object
- #synced_data_attribute ⇒ Object
- #synced_id_attribute ⇒ Object
- #synced_updated_at_timestamp_attribute ⇒ Object
- #transaction_provider ⇒ Object
Class Method Summary collapse
Instance Method Summary collapse
- #add_attributes_mapping_for_model(model_name) ⇒ Object
- #attributes_mapping_for_model(model_name) ⇒ Object
- #attributes_mapping_for_models ⇒ Object
- #message_filter ⇒ Object
- #message_filter=(val) ⇒ Object
Instance Attribute Details
#consumer_base_class ⇒ Object
63 64 65 |
# File 'lib/dionysus/consumer/config.rb', line 63 def consumer_base_class @consumer_base_class || Karafka::BaseConsumer end |
#event_bus ⇒ Object
35 36 37 |
# File 'lib/dionysus/consumer/config.rb', line 35 def event_bus @event_bus || Dionysus::Utils::NullEventBus end |
#instrumenter ⇒ Object
31 32 33 |
# File 'lib/dionysus/consumer/config.rb', line 31 def instrumenter @instrumenter || Dionysus::Utils::NullInstrumenter end |
#message_filters ⇒ Object
103 104 105 |
# File 'lib/dionysus/consumer/config.rb', line 103 def @message_filters || Array.wrap() end |
#model_factory ⇒ Object
19 20 21 |
# File 'lib/dionysus/consumer/config.rb', line 19 def model_factory @model_factory || Dionysus::Utils::NullModelFactory end |
#processing_mutex_method_name ⇒ Object
27 28 29 |
# File 'lib/dionysus/consumer/config.rb', line 27 def processing_mutex_method_name @processing_mutex_method_name || :with_lock end |
#processing_mutex_provider ⇒ Object
23 24 25 |
# File 'lib/dionysus/consumer/config.rb', line 23 def processing_mutex_provider @processing_mutex_provider || Dionysus::Utils::NullMutexProvider end |
#registry ⇒ Object
Returns the value of attribute registry.
4 5 6 |
# File 'lib/dionysus/consumer/config.rb', line 4 def registry @registry end |
#resolve_synced_data_hash_proc ⇒ Object
83 84 85 86 87 |
# File 'lib/dionysus/consumer/config.rb', line 83 def resolve_synced_data_hash_proc @resolve_synced_data_hash_proc || lambda do |record| record.public_send(Dionysus::Consumer.configuration.synced_data_attribute).to_h end end |
#retry_provider ⇒ Object
67 68 69 |
# File 'lib/dionysus/consumer/config.rb', line 67 def retry_provider @retry_provider || Dionysus::Utils::NullRetryProvider end |
#sidekiq_queue ⇒ Object
89 90 91 |
# File 'lib/dionysus/consumer/config.rb', line 89 def sidekiq_queue @sidekiq_queue || self.class.default_sidekiq_queue end |
#soft_delete_strategy ⇒ Object
39 40 41 |
# File 'lib/dionysus/consumer/config.rb', line 39 def soft_delete_strategy @soft_delete_strategy || :cancel end |
#soft_deleted_at_timestamp_attribute ⇒ Object
43 44 45 |
# File 'lib/dionysus/consumer/config.rb', line 43 def @soft_deleted_at_timestamp_attribute || :synced_canceled_at end |
#synced_created_at_timestamp_attribute ⇒ Object
47 48 49 |
# File 'lib/dionysus/consumer/config.rb', line 47 def @synced_created_at_timestamp_attribute || :synced_created_at end |
#synced_data_attribute ⇒ Object
59 60 61 |
# File 'lib/dionysus/consumer/config.rb', line 59 def synced_data_attribute @synced_data_attribute || :synced_data end |
#synced_id_attribute ⇒ Object
55 56 57 |
# File 'lib/dionysus/consumer/config.rb', line 55 def synced_id_attribute @synced_id_attribute || :synced_id end |
#synced_updated_at_timestamp_attribute ⇒ Object
51 52 53 |
# File 'lib/dionysus/consumer/config.rb', line 51 def @synced_updated_at_timestamp_attribute || :synced_updated_at end |
#transaction_provider ⇒ Object
15 16 17 |
# File 'lib/dionysus/consumer/config.rb', line 15 def transaction_provider @transaction_provider || Dionysus::Utils::NullTransactionProvider end |
Class Method Details
.default_sidekiq_queue ⇒ Object
11 12 13 |
# File 'lib/dionysus/consumer/config.rb', line 11 def self.default_sidekiq_queue :dionysus end |
Instance Method Details
#add_attributes_mapping_for_model(model_name) ⇒ Object
71 72 73 |
# File 'lib/dionysus/consumer/config.rb', line 71 def add_attributes_mapping_for_model(model_name) attributes_mapping_for_models[model_name.to_s] = yield end |
#attributes_mapping_for_model(model_name) ⇒ Object
79 80 81 |
# File 'lib/dionysus/consumer/config.rb', line 79 def attributes_mapping_for_model(model_name) attributes_mapping_for_models.fetch(model_name.to_s, {}) end |
#attributes_mapping_for_models ⇒ Object
75 76 77 |
# File 'lib/dionysus/consumer/config.rb', line 75 def attributes_mapping_for_models @attributes_mapping_for_models ||= {} end |
#message_filter ⇒ Object
93 94 95 96 |
# File 'lib/dionysus/consumer/config.rb', line 93 def @message_filter || Dionysus::Utils::DefaultMessageFilter.new(error_handler: Dionysus::Utils::NullErrorHandler) end |
#message_filter=(val) ⇒ Object
98 99 100 101 |
# File 'lib/dionysus/consumer/config.rb', line 98 def (val) @message_filter = val self. = [val] end |