redis-repeater 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -48,7 +48,7 @@ module RedisRepeater
48
48
  EventMachine::run do
49
49
  queues.each do |name, timeout|
50
50
  puts "#{name} - #{timeout}"
51
- scheduler << TransferSchedulerJob.new(name, timeout, logger, redis_from, redis_to)
51
+ scheduler << TransferSchedulerJob.new(name, timeout, logger, redis_from, redis_to, config['counter'])
52
52
  end
53
53
  end
54
54
 
@@ -4,9 +4,10 @@ module RedisRepeater
4
4
 
5
5
  class TransferSchedulerJob < SchedulerJob
6
6
 
7
- def initialize(name, timeout, logger, redis_from, redis_to)
7
+ def initialize(name, timeout, logger, redis_from, redis_to, maintain_count)
8
8
  @redis_from = redis_from
9
9
  @redis_to = redis_to
10
+ @maintain_count = maintain_count
10
11
  super(name, timeout, logger)
11
12
  end
12
13
 
@@ -17,6 +18,7 @@ module RedisRepeater
17
18
  @redis_to.rpush(@name, item)
18
19
  count += 1
19
20
  end
21
+ @redis_from.incrby("redis-repeater:#{@name}:count", count) if @maintain_count
20
22
  @logger.debug "Transported #{count} items for #{@name}"
21
23
  end
22
24
 
@@ -1,5 +1,5 @@
1
1
  module RedisRepeater
2
2
 
3
- VERSION = [0, 0, 5]
3
+ VERSION = [0, 0, 6]
4
4
 
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -23,11 +23,11 @@ def stop_servers
23
23
  end
24
24
  end
25
25
 
26
- def start_repeater
26
+ def start_repeater(type = :default)
27
27
  print 'starting the repeater.. '
28
28
  # TODO deamonize
29
29
  @rthread = Thread.start do
30
- RedisRepeater.start(File.dirname(__FILE__) + '/support/config')
30
+ RedisRepeater.start(File.dirname(__FILE__) + "/support/config/#{type}")
31
31
  end
32
32
  puts 'DONE'
33
33
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-repeater
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.5
4
+ hash: 19
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 6
10
+ version: 0.0.6
6
11
  platform: ruby
7
12
  authors:
8
13
  - John Crepezzi
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-03-10 00:00:00 -05:00
18
+ date: 2011-03-11 00:00:00 -05:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
@@ -21,6 +26,9 @@ dependencies:
21
26
  requirements:
22
27
  - - ">="
23
28
  - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
24
32
  version: "0"
25
33
  type: :development
26
34
  version_requirements: *id001
@@ -32,6 +40,9 @@ dependencies:
32
40
  requirements:
33
41
  - - ">="
34
42
  - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
35
46
  version: "0"
36
47
  type: :runtime
37
48
  version_requirements: *id002
@@ -43,6 +54,9 @@ dependencies:
43
54
  requirements:
44
55
  - - ">="
45
56
  - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
46
60
  version: "0"
47
61
  type: :runtime
48
62
  version_requirements: *id003
@@ -76,17 +90,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
90
  requirements:
77
91
  - - ">="
78
92
  - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
79
96
  version: "0"
80
97
  required_rubygems_version: !ruby/object:Gem::Requirement
81
98
  none: false
82
99
  requirements:
83
100
  - - ">="
84
101
  - !ruby/object:Gem::Version
102
+ hash: 3
103
+ segments:
104
+ - 0
85
105
  version: "0"
86
106
  requirements: []
87
107
 
88
108
  rubyforge_project: redis-repeater
89
- rubygems_version: 1.5.0
109
+ rubygems_version: 1.3.7
90
110
  signing_key:
91
111
  specification_version: 3
92
112
  summary: Redis Repeater