Class: Dionysus::Producer::Outbox::TombstonePublisher
- Inherits:
-
Object
- Object
- Dionysus::Producer::Outbox::TombstonePublisher
- Defined in:
- lib/dionysus/producer/outbox/tombstone_publisher.rb
Instance Method Summary collapse
-
#initialize(config: Dionysus::Producer.configuration) ⇒ TombstonePublisher
constructor
A new instance of TombstonePublisher.
- #tombstone(resource, responder, options = {}) ⇒ Object
Constructor Details
#initialize(config: Dionysus::Producer.configuration) ⇒ TombstonePublisher
Returns a new instance of TombstonePublisher.
10 11 12 |
# File 'lib/dionysus/producer/outbox/tombstone_publisher.rb', line 10 def initialize(config: Dionysus::Producer.configuration) @config = config end |
Instance Method Details
#tombstone(resource, responder, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/dionysus/producer/outbox/tombstone_publisher.rb', line 14 def tombstone(resource, responder, = {}) partition_key = .fetch(:partition_key) do Dionysus::Producer::PartitionKey.new(resource, config: config).to_key(responder: responder) end key = .fetch(:key) { Dionysus::Producer::Key.new(resource).to_key } responder.call(TOMBSTONE, partition_key: partition_key, key: key) end |