Class: Dionysus::Consumer::Persistor
- Inherits:
-
Object
- Object
- Dionysus::Consumer::Persistor
- Defined in:
- lib/dionysus/consumer/persistor.rb
Instance Method Summary collapse
-
#initialize(config, topic) ⇒ Persistor
constructor
A new instance of Persistor.
- #persist(dionysus_event, batch_number) ⇒ Object
Constructor Details
#initialize(config, topic) ⇒ Persistor
Returns a new instance of Persistor.
7 8 9 10 |
# File 'lib/dionysus/consumer/persistor.rb', line 7 def initialize(config, topic) @config = config @topic = topic end |
Instance Method Details
#persist(dionysus_event, batch_number) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/dionysus/consumer/persistor.rb', line 12 def persist(dionysus_event, batch_number) if dionysus_event.generic_event? if dionysus_event.created? && topic.[:import] == true persist_via_dionysus_create(dionysus_event, batch_number) elsif dionysus_event.destroyed? && topic.[:import] == true persist_via_dionysus_destroy(dionysus_event, batch_number) else persist_standard_event(dionysus_event, batch_number) end else log_unknown_event_type(dionysus_event) end end |