Class: Sbmt::Outbox::RetryStrategies::LatestAvailable

Inherits:
Base show all
Defined in:
app/interactors/sbmt/outbox/retry_strategies/latest_available.rb

Direct Known Subclasses

CompactedLog

Instance Method Summary collapse

Methods inherited from DryInteractor

call

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/interactors/sbmt/outbox/retry_strategies/latest_available.rb', line 7

def call
  unless item.has_attribute?(:event_key)
    return Failure(:missing_event_key)
  end

  if item.event_key.nil?
    return Failure(:empty_event_key)
  end

  if delivered_later?
    Failure(:discard_item)
  else
    Success()
  end
end