kestrel-client 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kestrel-client}
8
- s.version = "0.5.0"
8
+ s.version = "0.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Freels", "Rael Dornfest"]
12
- s.date = %q{2010-08-26}
12
+ s.date = %q{2010-09-29}
13
13
  s.description = %q{Ruby client for the Kestrel queue server}
14
14
  s.email = %q{rael@twitter.com}
15
15
  s.extra_rdoc_files = [
@@ -30,9 +30,9 @@ Gem::Specification.new do |s|
30
30
  "lib/kestrel/client/namespace.rb",
31
31
  "lib/kestrel/client/partitioning.rb",
32
32
  "lib/kestrel/client/proxy.rb",
33
- "lib/kestrel/client/reliable.rb",
34
33
  "lib/kestrel/client/retry_helper.rb",
35
34
  "lib/kestrel/client/stats_helper.rb",
35
+ "lib/kestrel/client/transactional.rb",
36
36
  "lib/kestrel/client/unmarshal.rb",
37
37
  "lib/kestrel/config.rb",
38
38
  "spec/kestrel/client/blocking_spec.rb",
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  "spec/kestrel/client/json_spec.rb",
41
41
  "spec/kestrel/client/namespace_spec.rb",
42
42
  "spec/kestrel/client/partitioning_spec.rb",
43
- "spec/kestrel/client/reliable_spec.rb",
43
+ "spec/kestrel/client/transactional_spec.rb",
44
44
  "spec/kestrel/client/unmarshal_spec.rb",
45
45
  "spec/kestrel/client_spec.rb",
46
46
  "spec/kestrel/config/kestrel.yml",
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
60
60
  "spec/kestrel/client/json_spec.rb",
61
61
  "spec/kestrel/client/namespace_spec.rb",
62
62
  "spec/kestrel/client/partitioning_spec.rb",
63
- "spec/kestrel/client/reliable_spec.rb",
63
+ "spec/kestrel/client/transactional_spec.rb",
64
64
  "spec/kestrel/client/unmarshal_spec.rb",
65
65
  "spec/kestrel/client_spec.rb",
66
66
  "spec/kestrel/config_spec.rb",
@@ -10,7 +10,7 @@ module Kestrel
10
10
  autoload :Unmarshal, 'kestrel/client/unmarshal'
11
11
  autoload :Namespace, 'kestrel/client/namespace'
12
12
  autoload :Json, 'kestrel/client/json'
13
- autoload :Reliable, "kestrel/client/reliable"
13
+ autoload :Transactional, "kestrel/client/transactional"
14
14
 
15
15
  KESTREL_OPTIONS = [:gets_per_server, :exception_retry_limit, :get_timeout_ms].freeze
16
16
 
@@ -100,9 +100,9 @@ module Kestrel
100
100
  # allows collision-avoiding options support.
101
101
  #
102
102
  # ==== Options (opts)
103
- # :open<Boolean>:: Begins a reliable read.
104
- # :close<Boolean>:: Ends a reliable read.
105
- # :abort<Boolean>:: Cancels an existing reliable read
103
+ # :open<Boolean>:: Begins a transactional read.
104
+ # :close<Boolean>:: Ends a transactional read.
105
+ # :abort<Boolean>:: Cancels an existing transactional read
106
106
  # :peek<Boolean>:: Return the head of the queue, without removal
107
107
  # :timeout<Integer>:: Milliseconds to block for a new item
108
108
  # :raw<Boolean>:: Toggles Marshalling. Equivalent to the "old
@@ -1,4 +1,4 @@
1
- class Kestrel::Client::Reliable < Kestrel::Client::Proxy
1
+ class Kestrel::Client::Transactional < Kestrel::Client::Proxy
2
2
 
3
3
  # Raised when a caller attempts to use this proxy across
4
4
  # multiple queues.
@@ -1,10 +1,10 @@
1
1
  require 'spec/spec_helper'
2
2
 
3
- describe "Kestrel::Client::Reliable" do
3
+ describe "Kestrel::Client::Transactional" do
4
4
  describe "Instance Methods" do
5
5
  before do
6
6
  @raw_kestrel_client = Kestrel::Client.new(*Kestrel::Config.default)
7
- @kestrel = Kestrel::Client::Reliable.new(@raw_kestrel_client, nil, nil, 1)
7
+ @kestrel = Kestrel::Client::Transactional.new(@raw_kestrel_client, nil, nil, 1)
8
8
  stub(@kestrel).rand { 1 }
9
9
  @queue = "some_queue"
10
10
  end
@@ -17,35 +17,35 @@ describe "Kestrel::Client::Reliable" do
17
17
  end
18
18
 
19
19
  it "gets from the error queue ERROR_PROCESSING_RATE pct. of the time" do
20
- mock(@kestrel).rand { Kestrel::Client::Reliable::ERROR_PROCESSING_RATE - 0.05 }
20
+ mock(@kestrel).rand { Kestrel::Client::Transactional::ERROR_PROCESSING_RATE - 0.05 }
21
21
  mock(@raw_kestrel_client).get(@queue + "_errors", anything) { :mcguffin }
22
22
  mock(@raw_kestrel_client).get(@queue, anything).never
23
23
  @kestrel.get(@queue).should == :mcguffin
24
24
  end
25
25
 
26
26
  it "falls through to the normal queue when error queue is empty" do
27
- mock(@kestrel).rand { Kestrel::Client::Reliable::ERROR_PROCESSING_RATE - 0.05 }
27
+ mock(@kestrel).rand { Kestrel::Client::Transactional::ERROR_PROCESSING_RATE - 0.05 }
28
28
  mock(@raw_kestrel_client).get(@queue + "_errors", anything) { nil }
29
29
  mock(@raw_kestrel_client).get(@queue, anything) { :mcguffin }
30
30
  @kestrel.get(@queue).should == :mcguffin
31
31
  end
32
32
 
33
33
  it "gets from the normal queue most of the time" do
34
- mock(@kestrel).rand { Kestrel::Client::Reliable::ERROR_PROCESSING_RATE + 0.05 }
34
+ mock(@kestrel).rand { Kestrel::Client::Transactional::ERROR_PROCESSING_RATE + 0.05 }
35
35
  mock(@raw_kestrel_client).get(@queue, anything) { :mcguffin }
36
36
  mock(@raw_kestrel_client).get(@queue + "_errors", anything).never
37
37
  @kestrel.get(@queue).should == :mcguffin
38
38
  end
39
39
 
40
40
  it "falls through to the error queue when normal queue is empty" do
41
- mock(@kestrel).rand { Kestrel::Client::Reliable::ERROR_PROCESSING_RATE + 0.05 }
41
+ mock(@kestrel).rand { Kestrel::Client::Transactional::ERROR_PROCESSING_RATE + 0.05 }
42
42
  mock(@raw_kestrel_client).get(@queue, anything) { nil }
43
43
  mock(@raw_kestrel_client).get(@queue + "_errors", anything) { :mcguffin }
44
44
  @kestrel.get(@queue).should == :mcguffin
45
45
  end
46
46
 
47
47
  it "is nil when both queues are empty" do
48
- mock(@kestrel).rand { Kestrel::Client::Reliable::ERROR_PROCESSING_RATE + 0.05 }
48
+ mock(@kestrel).rand { Kestrel::Client::Transactional::ERROR_PROCESSING_RATE + 0.05 }
49
49
  mock(@raw_kestrel_client).get(@queue, anything) { nil }
50
50
  mock(@raw_kestrel_client).get(@queue + "_errors", anything) { nil }
51
51
  @kestrel.get(@queue).should be_nil
@@ -54,7 +54,7 @@ describe "Kestrel::Client::Reliable" do
54
54
  it "returns the payload of a RetryableJob" do
55
55
  stub(@kestrel).rand { 0 }
56
56
  mock(@raw_kestrel_client).get(@queue + "_errors", anything) do
57
- Kestrel::Client::Reliable::RetryableJob.new(1, :mcmuffin)
57
+ Kestrel::Client::Transactional::RetryableJob.new(1, :mcmuffin)
58
58
  end
59
59
 
60
60
  @kestrel.get(@queue).should == :mcmuffin
@@ -72,7 +72,7 @@ describe "Kestrel::Client::Reliable" do
72
72
  it "closes an open transaction with retries" do
73
73
  stub(@kestrel).rand { 0 }
74
74
  stub(@raw_kestrel_client).get(@queue + "_errors", anything) do
75
- Kestrel::Client::Reliable::RetryableJob.new(1, :mcmuffin)
75
+ Kestrel::Client::Transactional::RetryableJob.new(1, :mcmuffin)
76
76
  end
77
77
  @kestrel.get(@queue)
78
78
 
@@ -86,7 +86,7 @@ describe "Kestrel::Client::Reliable" do
86
86
 
87
87
  lambda do
88
88
  @kestrel.get("transaction_fail")
89
- end.should raise_error(Kestrel::Client::Reliable::MultipleQueueException)
89
+ end.should raise_error(Kestrel::Client::Transactional::MultipleQueueException)
90
90
  end
91
91
  end
92
92
 
@@ -105,7 +105,7 @@ describe "Kestrel::Client::Reliable" do
105
105
  it "returns 1 plus the number of tries for a RetryableJob" do
106
106
  stub(@kestrel).rand { 0 }
107
107
  mock(@raw_kestrel_client).get(@queue + "_errors", anything) do
108
- Kestrel::Client::Reliable::RetryableJob.new(1, :mcmuffin)
108
+ Kestrel::Client::Transactional::RetryableJob.new(1, :mcmuffin)
109
109
  end
110
110
  @kestrel.get(@queue)
111
111
  @kestrel.current_try.should == 2
@@ -131,7 +131,7 @@ describe "Kestrel::Client::Reliable" do
131
131
  it "increments the retry count and re-enqueues the retried job" do
132
132
  stub(@kestrel).rand { 0 }
133
133
  stub(@raw_kestrel_client).get(@queue + "_errors", anything) do
134
- Kestrel::Client::Reliable::RetryableJob.new(1, :mcmuffin)
134
+ Kestrel::Client::Transactional::RetryableJob.new(1, :mcmuffin)
135
135
  end
136
136
 
137
137
  mock(@raw_kestrel_client).set(@queue + "_errors", anything) do |queue, job|
@@ -146,7 +146,7 @@ describe "Kestrel::Client::Reliable" do
146
146
  it "does not enqueue the retried job after too many tries" do
147
147
  stub(@kestrel).rand { 0 }
148
148
  stub(@raw_kestrel_client).get(@queue + "_errors", anything) do
149
- Kestrel::Client::Reliable::RetryableJob.new(Kestrel::Client::Reliable::DEFAULT_RETRIES - 1, :mcmuffin)
149
+ Kestrel::Client::Transactional::RetryableJob.new(Kestrel::Client::Transactional::DEFAULT_RETRIES - 1, :mcmuffin)
150
150
  end
151
151
  mock(@raw_kestrel_client).set(@queue + "_errors", anything).never
152
152
  @kestrel.get(@queue)
@@ -164,7 +164,7 @@ describe "Kestrel::Client::Reliable" do
164
164
  it "closes an open transaction with retries" do
165
165
  stub(@kestrel).rand { 0 }
166
166
  stub(@raw_kestrel_client).get(@queue + "_errors", anything) do
167
- Kestrel::Client::Reliable::RetryableJob.new(1, :mcmuffin)
167
+ Kestrel::Client::Transactional::RetryableJob.new(1, :mcmuffin)
168
168
  end
169
169
  @kestrel.get(@queue)
170
170
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kestrel-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Freels
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-08-26 00:00:00 -07:00
19
+ date: 2010-09-29 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -57,9 +57,9 @@ files:
57
57
  - lib/kestrel/client/namespace.rb
58
58
  - lib/kestrel/client/partitioning.rb
59
59
  - lib/kestrel/client/proxy.rb
60
- - lib/kestrel/client/reliable.rb
61
60
  - lib/kestrel/client/retry_helper.rb
62
61
  - lib/kestrel/client/stats_helper.rb
62
+ - lib/kestrel/client/transactional.rb
63
63
  - lib/kestrel/client/unmarshal.rb
64
64
  - lib/kestrel/config.rb
65
65
  - spec/kestrel/client/blocking_spec.rb
@@ -67,7 +67,7 @@ files:
67
67
  - spec/kestrel/client/json_spec.rb
68
68
  - spec/kestrel/client/namespace_spec.rb
69
69
  - spec/kestrel/client/partitioning_spec.rb
70
- - spec/kestrel/client/reliable_spec.rb
70
+ - spec/kestrel/client/transactional_spec.rb
71
71
  - spec/kestrel/client/unmarshal_spec.rb
72
72
  - spec/kestrel/client_spec.rb
73
73
  - spec/kestrel/config/kestrel.yml
@@ -115,7 +115,7 @@ test_files:
115
115
  - spec/kestrel/client/json_spec.rb
116
116
  - spec/kestrel/client/namespace_spec.rb
117
117
  - spec/kestrel/client/partitioning_spec.rb
118
- - spec/kestrel/client/reliable_spec.rb
118
+ - spec/kestrel/client/transactional_spec.rb
119
119
  - spec/kestrel/client/unmarshal_spec.rb
120
120
  - spec/kestrel/client_spec.rb
121
121
  - spec/kestrel/config_spec.rb