class QuartzTorrent::TimerManager::TimerInfo

Attributes

cancelled[RW]

Since pqueue doesn’t allow removal of anything but the head we flag deleted items so they are deleted when they are pulled

duration[RW]
expiry[RW]
metainfo[RW]
recurring[RW]

Public Class Methods

new(duration, recurring, metainfo) click to toggle source
# File lib/quartz_torrent/timermanager.rb, line 7
def initialize(duration, recurring, metainfo)
  @duration = duration
  @recurring = recurring
  @metainfo = metainfo
  @cancelled = false
  refresh
end

Public Instance Methods

refresh() click to toggle source
# File lib/quartz_torrent/timermanager.rb, line 26
def refresh
  @expiry = Time.new + @duration
end
secondsUntilExpiry() click to toggle source
# File lib/quartz_torrent/timermanager.rb, line 22
def secondsUntilExpiry
  @expiry - Time.new
end