Module: Railbox::Handler::ClassMethods
- Defined in:
- lib/railbox/handler/handler.rb
Instance Attribute Summary collapse
-
#outbox_entity ⇒ Object
Returns the value of attribute outbox_entity.
Instance Method Summary collapse
-
#enqueue(method: 'create', body: {}, **opts) ⇒ Object
Queues a request for asynchronous execution.
-
#on_failure ⇒ Object
Base failure hook: - can be safely called even if not overridden in the service; - does nothing by default; - when overridden, has access to
outbox_entity.
Instance Attribute Details
#outbox_entity ⇒ Object
Returns the value of attribute outbox_entity.
21 22 23 |
# File 'lib/railbox/handler/handler.rb', line 21 def outbox_entity @outbox_entity end |
Instance Method Details
#enqueue(method: 'create', body: {}, **opts) ⇒ Object
Queues a request for asynchronous execution
28 29 30 |
# File 'lib/railbox/handler/handler.rb', line 28 def enqueue(method: 'create', body: {}, **opts) HandlingQueue.enqueue(service: name, method: method, body: body, **opts) end |
#on_failure ⇒ Object
Base failure hook:
- can be safely called even if not overridden in the service;
- does nothing by default;
- when overridden, has access to
outbox_entity.
36 37 38 |
# File 'lib/railbox/handler/handler.rb', line 36 def on_failure # no-op by default end |