Class: Prosody::Timer
- Inherits:
-
Object
- Object
- Prosody::Timer
- Defined in:
- lib/prosody/native_stubs.rb
Overview
Represents a timer that was scheduled to fire at a specific time.
Timer instances are created by the native code and passed to your EventHandler’s #on_timer method when a scheduled timer fires.
Instance Method Summary collapse
-
#initialize ⇒ Timer
constructor
A new instance of Timer.
-
#key ⇒ String
Returns the entity key identifying what this timer belongs to.
-
#time ⇒ Time
Returns the time when this timer was scheduled to fire.
Constructor Details
#initialize ⇒ Timer
Returns a new instance of Timer.
244 245 246 |
# File 'lib/prosody/native_stubs.rb', line 244 def initialize raise NotImplementedError, "This class is implemented natively in Rust" end |
Instance Method Details
#key ⇒ String
Returns the entity key identifying what this timer belongs to.
The key is typically the same as the message key that was being processed when the timer was scheduled.
254 255 256 |
# File 'lib/prosody/native_stubs.rb', line 254 def key raise NotImplementedError, "This method is implemented natively in Rust" end |
#time ⇒ Time
Returns the time when this timer was scheduled to fire.
Note: Due to CompactDateTime’s second-level precision, the returned time will have zero nanoseconds even if the original scheduled time had sub-second precision.
265 266 267 |
# File 'lib/prosody/native_stubs.rb', line 265 def time raise NotImplementedError, "This method is implemented natively in Rust" end |