pegasus 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -3,7 +3,7 @@ module Pegasus
3
3
  def instance; @instance ||= new; end
4
4
 
5
5
  extend Forwardable
6
- def_delegators :redis, :rpush, :llen, :lindex, :get, :set, :del, :lpop, :incrby
6
+ def_delegators :redis, :rpush, :llen, :lindex, :get, :set, :del, :lpop, :incrby, :renamenx
7
7
 
8
8
  def playout *svcs
9
9
  @svcs ||= []
@@ -52,6 +52,12 @@ module Pegasus
52
52
  queue_with_ticket(nil, *a)
53
53
  end
54
54
 
55
+ def discard_queue!
56
+ backup_key = "#{wait_queue_key}_backup_#{Time.unix}"
57
+ renamenx wait_queue_key, backup_key
58
+ backup_key
59
+ end
60
+
55
61
  def trouble?
56
62
  return false unless next_task = lindex(wait_queue_key, 0)
57
63
  seconds_behind = Time.unix - next_task.split(' ', 2)[0].to_i
@@ -32,12 +32,6 @@ module Pegasus
32
32
  logger.info "#{self.class.name} NOOP"
33
33
  end
34
34
 
35
- def do_discard_queue!
36
- backup_key = "#{wait_queue_key}_backup_#{Time.unix}"
37
- renamenx wait_queue_key, backup_key
38
- backup_key
39
- end
40
-
41
35
  def play
42
36
  while next_task = lpop(wait_queue_key)
43
37
  run_task next_task
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Joe Edelman