Class: Prosody::Timer

Inherits:
Object
  • Object
show all
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.

See Also:

  • for implementation

Instance Method Summary collapse

Constructor Details

#initializeTimer

Returns a new instance of Timer.

Raises:

  • (NotImplementedError)


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

#keyString

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.

Returns:

  • (String)

    The entity key

Raises:

  • (NotImplementedError)


254
255
256
# File 'lib/prosody/native_stubs.rb', line 254

def key
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#timeTime

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.

Returns:

  • (Time)

    The scheduled execution time

Raises:

  • (NotImplementedError)


265
266
267
# File 'lib/prosody/native_stubs.rb', line 265

def time
  raise NotImplementedError, "This method is implemented natively in Rust"
end