Sha256: 4918e21eb6c5a3658670f2c83386aeb1772b91449569b4ffb769d8b5e8bb34eb

Contents?: true

Size: 357 Bytes

Versions: 2

Compression:

Stored size: 357 Bytes

Contents

module Ztimer
  class Slot
    attr_reader :expires_at, :callback
    attr_accessor :started_at, :executed_at

    def initialize(expires_at, &callback)
      @expires_at  = expires_at
      @callback    = callback
      @started_at  = nil
      @executed_at = nil
    end

    def <=>(other)
      return @expires_at <=> other.expires_at
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ztimer-0.1.1 lib/ztimer/slot.rb
ztimer-0.1.0 lib/ztimer/slot.rb