Class: CycloneLariat::Outbox
- Inherits:
-
Object
- Object
- CycloneLariat::Outbox
- Extended by:
- Configurable, Loadable
- Includes:
- LunaPark::Extensions::Injector
- Defined in:
- lib/cyclone_lariat/plugins/outbox.rb,
lib/cyclone_lariat/plugins/outbox/loadable.rb,
lib/cyclone_lariat/plugins/outbox/configurable.rb,
lib/cyclone_lariat/plugins/outbox/repo/messages.rb,
lib/cyclone_lariat/plugins/outbox/services/resend.rb,
lib/cyclone_lariat/plugins/outbox/mappers/messages.rb,
lib/cyclone_lariat/plugins/outbox/repo/sequel/messages.rb,
lib/cyclone_lariat/plugins/outbox/extensions/sequel_outbox.rb,
lib/cyclone_lariat/plugins/outbox/repo/active_record/messages.rb,
lib/cyclone_lariat/plugins/outbox/extensions/active_record_outbox.rb
Defined Under Namespace
Modules: Configurable, Extensions, Loadable, Mappers, Repo, Services
Constant Summary
Constants included from Configurable
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #<<(message) ⇒ Object
-
#initialize ⇒ Outbox
constructor
A new instance of Outbox.
- #publish ⇒ Object
- #push(message) ⇒ Object
Methods included from Configurable
Methods included from Loadable
Constructor Details
#initialize ⇒ Outbox
Returns a new instance of Outbox.
22 23 24 |
# File 'lib/cyclone_lariat/plugins/outbox.rb', line 22 def initialize @messages = [] end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
20 21 22 |
# File 'lib/cyclone_lariat/plugins/outbox.rb', line 20 def @messages end |
Instance Method Details
#<<(message) ⇒ Object
40 41 42 43 |
# File 'lib/cyclone_lariat/plugins/outbox.rb', line 40 def <<() .uuid = repo.create() << end |
#publish ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/cyclone_lariat/plugins/outbox.rb', line 26 def publish = .each_with_object([]) do |, | begin sns_client.publish , fifo: .fifo? << .uuid rescue StandardError => e repo.update_error(.uuid, e.) config.on_sending_error&.call(, e) next end end repo.delete() unless .empty? end |
#push(message) ⇒ Object
45 46 47 |
# File 'lib/cyclone_lariat/plugins/outbox.rb', line 45 def push() self << end |