Class: Actions::Candlepin::SuspendedAction
- Inherits:
-
Object
- Object
- Actions::Candlepin::SuspendedAction
- Defined in:
- app/lib/actions/candlepin/listen_on_candlepin_events.rb
Instance Method Summary collapse
-
#initialize(suspended_action) ⇒ SuspendedAction
constructor
A new instance of SuspendedAction.
- #notify_connected ⇒ Object
- #notify_fatal(error) ⇒ Object
- #notify_finished ⇒ Object
- #notify_message_received(id, subject, content) ⇒ Object
- #notify_not_connected(message) ⇒ Object
Constructor Details
#initialize(suspended_action) ⇒ SuspendedAction
Returns a new instance of SuspendedAction.
5 6 7 |
# File 'app/lib/actions/candlepin/listen_on_candlepin_events.rb', line 5 def initialize(suspended_action) @suspended_action = suspended_action end |
Instance Method Details
#notify_connected ⇒ Object
17 18 19 |
# File 'app/lib/actions/candlepin/listen_on_candlepin_events.rb', line 17 def notify_connected @suspended_action << Actions::Candlepin::ListenOnCandlepinEvents::Connected end |
#notify_fatal(error) ⇒ Object
13 14 15 |
# File 'app/lib/actions/candlepin/listen_on_candlepin_events.rb', line 13 def notify_fatal(error) @suspended_action << Actions::Candlepin::ListenOnCandlepinEvents::Fatal[error.backtrace && error.backtrace.join('\n'), error., error.class.name] end |
#notify_finished ⇒ Object
25 26 27 |
# File 'app/lib/actions/candlepin/listen_on_candlepin_events.rb', line 25 def notify_finished @suspended_action << Actions::Candlepin::ListenOnCandlepinEvents::Close end |
#notify_message_received(id, subject, content) ⇒ Object
9 10 11 |
# File 'app/lib/actions/candlepin/listen_on_candlepin_events.rb', line 9 def (id, subject, content) @suspended_action << Actions::Candlepin::ListenOnCandlepinEvents::Event[id, subject, content] end |
#notify_not_connected(message) ⇒ Object
21 22 23 |
# File 'app/lib/actions/candlepin/listen_on_candlepin_events.rb', line 21 def notify_not_connected() ForemanTasks.dynflow.world.clock.ping(@suspended_action, 5, Actions::Candlepin::ListenOnCandlepinEvents::Reconnect[]) end |