Class: NulogyMessageBusConsumer::Steps::DeduplicateMessages
- Inherits:
-
Object
- Object
- NulogyMessageBusConsumer::Steps::DeduplicateMessages
- Defined in:
- lib/nulogy_message_bus_consumer/steps/deduplicate_messages.rb
Instance Method Summary collapse
- #call(message:, **_) ⇒ Object
-
#initialize(logger) ⇒ DeduplicateMessages
constructor
A new instance of DeduplicateMessages.
Constructor Details
#initialize(logger) ⇒ DeduplicateMessages
Returns a new instance of DeduplicateMessages.
4 5 6 |
# File 'lib/nulogy_message_bus_consumer/steps/deduplicate_messages.rb', line 4 def initialize(logger) @logger = logger end |
Instance Method Details
#call(message:, **_) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nulogy_message_bus_consumer/steps/deduplicate_messages.rb', line 8 def call(message:, **_) return :success if duplicate_exists?() result = :unknown ProcessedMessage.transaction(joinable: false) do result = yield () if result == :success end result end |