Class: Prosody::EventHandler
- Inherits:
-
Object
- Object
- Prosody::EventHandler
- Extended by:
- ErrorClassification
- Defined in:
- lib/prosody/handler.rb
Overview
Abstract base class for handling incoming messages and timers from Prosody. Subclasses must implement ‘#on_message` to process received messages. Subclasses may implement `#on_timer` to process timer events. They may also use `permanent` or `transient` decorators to control retry logic.
Instance Method Summary collapse
-
#on_message(context, message) ⇒ void
Process a single message received from Prosody.
-
#on_timer(context, timer) ⇒ void
Process a timer event when it fires.
Methods included from ErrorClassification
Instance Method Details
#on_message(context, message) ⇒ void
This method returns an undefined value.
Process a single message received from Prosody. This method must be implemented by subclasses to define custom message handling logic.
162 163 164 |
# File 'lib/prosody/handler.rb', line 162 def (context, ) raise NotImplementedError, "Subclasses must implement #on_message" end |
#on_timer(context, timer) ⇒ void
This method returns an undefined value.
Process a timer event when it fires. This method must be implemented by subclasses to handle scheduled timer events if they can fire.
173 174 175 |
# File 'lib/prosody/handler.rb', line 173 def on_timer(context, timer) raise NotImplementedError, "Subclasses must implement #on_timer" end |