Class: QuartzTorrent::TimerManager::TimerInfo
- Inherits:
-
Object
- Object
- QuartzTorrent::TimerManager::TimerInfo
- Defined in:
- lib/quartz_torrent/timermanager.rb
Instance Attribute Summary collapse
-
#cancelled ⇒ Object
Since pqueue doesn’t allow removal of anything but the head we flag deleted items so they are deleted when they are pulled.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#expiry ⇒ Object
Returns the value of attribute expiry.
-
#metainfo ⇒ Object
Returns the value of attribute metainfo.
-
#recurring ⇒ Object
Returns the value of attribute recurring.
Instance Method Summary collapse
-
#initialize(duration, recurring, metainfo) ⇒ TimerInfo
constructor
A new instance of TimerInfo.
- #refresh ⇒ Object
- #secondsUntilExpiry ⇒ Object
Constructor Details
#initialize(duration, recurring, metainfo) ⇒ TimerInfo
Returns a new instance of TimerInfo.
7 8 9 10 11 12 13 |
# File 'lib/quartz_torrent/timermanager.rb', line 7 def initialize(duration, recurring, ) @duration = duration @recurring = recurring @metainfo = @cancelled = false refresh end |
Instance Attribute Details
#cancelled ⇒ Object
Since pqueue doesn’t allow removal of anything but the head we flag deleted items so they are deleted when they are pulled
20 21 22 |
# File 'lib/quartz_torrent/timermanager.rb', line 20 def cancelled @cancelled end |
#duration ⇒ Object
Returns the value of attribute duration.
15 16 17 |
# File 'lib/quartz_torrent/timermanager.rb', line 15 def duration @duration end |
#expiry ⇒ Object
Returns the value of attribute expiry.
16 17 18 |
# File 'lib/quartz_torrent/timermanager.rb', line 16 def expiry @expiry end |
#metainfo ⇒ Object
Returns the value of attribute metainfo.
17 18 19 |
# File 'lib/quartz_torrent/timermanager.rb', line 17 def @metainfo end |
#recurring ⇒ Object
Returns the value of attribute recurring.
14 15 16 |
# File 'lib/quartz_torrent/timermanager.rb', line 14 def recurring @recurring end |
Instance Method Details
#refresh ⇒ Object
26 27 28 |
# File 'lib/quartz_torrent/timermanager.rb', line 26 def refresh @expiry = Time.new + @duration end |
#secondsUntilExpiry ⇒ Object
22 23 24 |
# File 'lib/quartz_torrent/timermanager.rb', line 22 def secondsUntilExpiry @expiry - Time.new end |