gorgon 0.5.0.rc1 → 0.6.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/Gemfile.lock +2 -4
  2. data/gorgon.gemspec +0 -1
  3. data/lib/gorgon/amqp_service.rb +5 -5
  4. data/lib/gorgon/gem_command_handler.rb +2 -1
  5. data/lib/gorgon/listener.rb +7 -5
  6. data/lib/gorgon/originator_protocol.rb +1 -0
  7. data/lib/gorgon/version.rb +1 -1
  8. data/lib/gorgon/worker_manager.rb +5 -2
  9. data/lib/gorgon_amq-protocol/.gitignore +15 -0
  10. data/lib/gorgon_amq-protocol/.gitmodules +3 -0
  11. data/lib/gorgon_amq-protocol/.rspec +3 -0
  12. data/lib/gorgon_amq-protocol/.travis.yml +19 -0
  13. data/lib/gorgon_amq-protocol/lib/gorgon_amq/bit_set.rb +82 -0
  14. data/lib/gorgon_amq-protocol/lib/gorgon_amq/endianness.rb +15 -0
  15. data/lib/gorgon_amq-protocol/lib/gorgon_amq/int_allocator.rb +96 -0
  16. data/lib/gorgon_amq-protocol/lib/gorgon_amq/pack.rb +53 -0
  17. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol.rb +4 -0
  18. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb +2322 -0
  19. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/constants.rb +22 -0
  20. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/exceptions.rb +60 -0
  21. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/float_32bit.rb +14 -0
  22. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/frame.rb +210 -0
  23. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table.rb +142 -0
  24. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table_value_decoder.rb +190 -0
  25. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table_value_encoder.rb +123 -0
  26. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/type_constants.rb +26 -0
  27. data/lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/version.rb +5 -0
  28. data/lib/gorgon_amq-protocol/lib/gorgon_amq/settings.rb +114 -0
  29. data/lib/gorgon_amq-protocol/lib/gorgon_amq/uri.rb +37 -0
  30. data/lib/gorgon_bunny/lib/gorgon_amq/protocol/extensions.rb +16 -0
  31. data/lib/gorgon_bunny/lib/gorgon_bunny.rb +89 -0
  32. data/lib/gorgon_bunny/lib/gorgon_bunny/authentication/credentials_encoder.rb +55 -0
  33. data/lib/gorgon_bunny/lib/gorgon_bunny/authentication/external_mechanism_encoder.rb +27 -0
  34. data/lib/gorgon_bunny/lib/gorgon_bunny/authentication/plain_mechanism_encoder.rb +19 -0
  35. data/lib/gorgon_bunny/lib/gorgon_bunny/channel.rb +1875 -0
  36. data/lib/gorgon_bunny/lib/gorgon_bunny/channel_id_allocator.rb +80 -0
  37. data/lib/gorgon_bunny/lib/gorgon_bunny/compatibility.rb +24 -0
  38. data/lib/gorgon_bunny/lib/gorgon_bunny/concurrent/atomic_fixnum.rb +74 -0
  39. data/lib/gorgon_bunny/lib/gorgon_bunny/concurrent/condition.rb +66 -0
  40. data/lib/gorgon_bunny/lib/gorgon_bunny/concurrent/continuation_queue.rb +41 -0
  41. data/lib/gorgon_bunny/lib/gorgon_bunny/concurrent/linked_continuation_queue.rb +61 -0
  42. data/lib/gorgon_bunny/lib/gorgon_bunny/concurrent/synchronized_sorted_set.rb +56 -0
  43. data/lib/gorgon_bunny/lib/gorgon_bunny/consumer.rb +123 -0
  44. data/lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb +23 -0
  45. data/lib/gorgon_bunny/lib/gorgon_bunny/consumer_work_pool.rb +94 -0
  46. data/lib/gorgon_bunny/lib/gorgon_bunny/delivery_info.rb +93 -0
  47. data/lib/gorgon_bunny/lib/gorgon_bunny/exceptions.rb +236 -0
  48. data/lib/gorgon_bunny/lib/gorgon_bunny/exchange.rb +271 -0
  49. data/lib/gorgon_bunny/lib/gorgon_bunny/framing.rb +56 -0
  50. data/lib/gorgon_bunny/lib/gorgon_bunny/heartbeat_sender.rb +70 -0
  51. data/lib/gorgon_bunny/lib/gorgon_bunny/message_properties.rb +119 -0
  52. data/lib/gorgon_bunny/lib/gorgon_bunny/queue.rb +387 -0
  53. data/lib/gorgon_bunny/lib/gorgon_bunny/reader_loop.rb +116 -0
  54. data/lib/gorgon_bunny/lib/gorgon_bunny/return_info.rb +74 -0
  55. data/lib/gorgon_bunny/lib/gorgon_bunny/session.rb +1044 -0
  56. data/lib/gorgon_bunny/lib/gorgon_bunny/socket.rb +83 -0
  57. data/lib/gorgon_bunny/lib/gorgon_bunny/ssl_socket.rb +57 -0
  58. data/lib/gorgon_bunny/lib/gorgon_bunny/system_timer.rb +20 -0
  59. data/lib/gorgon_bunny/lib/gorgon_bunny/test_kit.rb +27 -0
  60. data/lib/gorgon_bunny/lib/gorgon_bunny/timeout.rb +18 -0
  61. data/lib/gorgon_bunny/lib/gorgon_bunny/transport.rb +398 -0
  62. data/lib/gorgon_bunny/lib/gorgon_bunny/version.rb +6 -0
  63. data/lib/gorgon_bunny/lib/gorgon_bunny/versioned_delivery_tag.rb +28 -0
  64. data/spec/crash_reporter_spec.rb +1 -1
  65. data/spec/gem_command_handler_spec.rb +2 -2
  66. data/spec/listener_spec.rb +5 -5
  67. data/spec/worker_manager_spec.rb +3 -3
  68. metadata +56 -17
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+
3
+ module GorgonBunny
4
+ # @return [String] Version of the library
5
+ VERSION = "1.0.0"
6
+ end
@@ -0,0 +1,28 @@
1
+ module GorgonBunny
2
+ # Wraps a delivery tag (which is an integer) so that {GorgonBunny::Channel} could
3
+ # detect stale tags after connection recovery.
4
+ #
5
+ # @private
6
+ class VersionedDeliveryTag
7
+ attr_reader :tag
8
+ attr_reader :version
9
+
10
+ def initialize(tag, version)
11
+ raise ArgumentError.new("tag cannot be nil") unless tag
12
+ raise ArgumentError.new("version cannot be nil") unless version
13
+
14
+ @tag = tag
15
+ @version = version
16
+ end
17
+
18
+ def to_i
19
+ @tag
20
+ end
21
+
22
+ def stale?(version)
23
+ raise ArgumentError.new("version cannot be nil") unless version
24
+
25
+ @version < version
26
+ end
27
+ end
28
+ end
@@ -1,7 +1,7 @@
1
1
  require 'gorgon/crash_reporter'
2
2
 
3
3
  describe "CrashReporter" do
4
- let(:exchange) { stub("Bunny Exchange", :publish => nil) }
4
+ let(:exchange) { stub("GorgonBunny Exchange", :publish => nil) }
5
5
  let(:info) { {
6
6
  :out_file => "stdout_file", :err_file => "stderr_file", :footer_text => "Text"
7
7
  } }
@@ -1,8 +1,8 @@
1
1
  require 'gorgon/gem_command_handler'
2
2
 
3
3
  describe GemCommandHandler do
4
- let(:exchange) { stub("Bunny Exchange", :publish => nil) }
5
- let(:bunny) { stub("Bunny", :exchange => exchange, :stop => nil) }
4
+ let(:exchange) { stub("GorgonBunny Exchange", :publish => nil) }
5
+ let(:bunny) { stub("GorgonBunny", :exchange => exchange, :stop => nil) }
6
6
 
7
7
  let(:payload) {
8
8
  {:type => :update, :reply_exchange_name => "name",
@@ -2,14 +2,14 @@ require 'gorgon/listener'
2
2
 
3
3
  describe Listener do
4
4
  let(:connection_information) { double }
5
- let(:queue) { stub("Bunny Queue", :bind => nil) }
6
- let(:exchange) { stub("Bunny Exchange", :publish => nil) }
7
- let(:bunny) { stub("Bunny", :start => nil, :queue => queue, :exchange => exchange) }
5
+ let(:queue) { stub("GorgonBunny Queue", :bind => nil) }
6
+ let(:exchange) { stub("GorgonBunny Exchange", :publish => nil) }
7
+ let(:bunny) { stub("GorgonBunny", :start => nil, :queue => queue, :exchange => exchange) }
8
8
  let(:logger) { stub("Logger", :info => true, :datetime_format= => "")}
9
9
 
10
10
  before do
11
11
  Logger.stub(:new).and_return(logger)
12
- Bunny.stub(:new).and_return(bunny)
12
+ GorgonBunny.stub(:new).and_return(bunny)
13
13
  Listener.any_instance.stub(:configuration => {})
14
14
  Listener.any_instance.stub(:connection_information => connection_information)
15
15
  end
@@ -75,7 +75,7 @@ describe Listener do
75
75
 
76
76
  describe "#connect" do
77
77
  it "connects" do
78
- Bunny.should_receive(:new).with(connection_information).and_return(bunny)
78
+ GorgonBunny.should_receive(:new).with(connection_information).and_return(bunny)
79
79
  bunny.should_receive(:start)
80
80
 
81
81
  listener.connect
@@ -1,10 +1,10 @@
1
1
  require 'gorgon/worker_manager'
2
2
 
3
3
  describe WorkerManager do
4
- let(:exchange) { stub("Bunny Exchange", :publish => nil) }
4
+ let(:exchange) { stub("GorgonBunny Exchange", :publish => nil) }
5
5
  let(:queue) { stub("Queue", :bind => nil, :subscribe => nil, :delete => nil,
6
6
  :pop => {:payload => :queue_empty}) }
7
- let(:bunny) { stub("Bunny", :start => nil, :exchange => exchange,
7
+ let(:bunny) { stub("GorgonBunny", :start => nil, :exchange => exchange,
8
8
  :queue => queue, :stop => nil) }
9
9
  before do
10
10
  STDIN.stub!(:read).and_return "{}"
@@ -12,7 +12,7 @@ describe WorkerManager do
12
12
  STDERR.stub!(:reopen)
13
13
  STDOUT.stub!(:sync)
14
14
  STDERR.stub!(:sync)
15
- Bunny.stub!(:new).and_return(bunny)
15
+ GorgonBunny.stub!(:new).and_return(bunny)
16
16
  Configuration.stub!(:load_configuration_from_file).and_return({})
17
17
  EventMachine.stub!(:run).and_yield
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorgon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.rc1
4
+ version: 0.6.0.rc1
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -175,22 +175,6 @@ dependencies:
175
175
  - - '='
176
176
  - !ruby/object:Gem::Version
177
177
  version: 2.1.3
178
- - !ruby/object:Gem::Dependency
179
- name: bunny
180
- requirement: !ruby/object:Gem::Requirement
181
- none: false
182
- requirements:
183
- - - '='
184
- - !ruby/object:Gem::Version
185
- version: 0.8.0
186
- type: :runtime
187
- prerelease: false
188
- version_requirements: !ruby/object:Gem::Requirement
189
- none: false
190
- requirements:
191
- - - '='
192
- - !ruby/object:Gem::Version
193
- version: 0.8.0
194
178
  description: Gorgon provides a method for distributing the workload of running a ruby
195
179
  test suites. It relies on amqp for message passing, and rsync for the synchronization
196
180
  of source code.
@@ -248,6 +232,61 @@ files:
248
232
  - lib/gorgon/version.rb
249
233
  - lib/gorgon/worker.rb
250
234
  - lib/gorgon/worker_manager.rb
235
+ - lib/gorgon_amq-protocol/.gitignore
236
+ - lib/gorgon_amq-protocol/.gitmodules
237
+ - lib/gorgon_amq-protocol/.rspec
238
+ - lib/gorgon_amq-protocol/.travis.yml
239
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/bit_set.rb
240
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/endianness.rb
241
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/int_allocator.rb
242
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/pack.rb
243
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol.rb
244
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb
245
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/constants.rb
246
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/exceptions.rb
247
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/float_32bit.rb
248
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/frame.rb
249
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table.rb
250
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table_value_decoder.rb
251
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table_value_encoder.rb
252
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/type_constants.rb
253
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/version.rb
254
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/settings.rb
255
+ - lib/gorgon_amq-protocol/lib/gorgon_amq/uri.rb
256
+ - lib/gorgon_bunny/lib/gorgon_amq/protocol/extensions.rb
257
+ - lib/gorgon_bunny/lib/gorgon_bunny.rb
258
+ - lib/gorgon_bunny/lib/gorgon_bunny/authentication/credentials_encoder.rb
259
+ - lib/gorgon_bunny/lib/gorgon_bunny/authentication/external_mechanism_encoder.rb
260
+ - lib/gorgon_bunny/lib/gorgon_bunny/authentication/plain_mechanism_encoder.rb
261
+ - lib/gorgon_bunny/lib/gorgon_bunny/channel.rb
262
+ - lib/gorgon_bunny/lib/gorgon_bunny/channel_id_allocator.rb
263
+ - lib/gorgon_bunny/lib/gorgon_bunny/compatibility.rb
264
+ - lib/gorgon_bunny/lib/gorgon_bunny/concurrent/atomic_fixnum.rb
265
+ - lib/gorgon_bunny/lib/gorgon_bunny/concurrent/condition.rb
266
+ - lib/gorgon_bunny/lib/gorgon_bunny/concurrent/continuation_queue.rb
267
+ - lib/gorgon_bunny/lib/gorgon_bunny/concurrent/linked_continuation_queue.rb
268
+ - lib/gorgon_bunny/lib/gorgon_bunny/concurrent/synchronized_sorted_set.rb
269
+ - lib/gorgon_bunny/lib/gorgon_bunny/consumer.rb
270
+ - lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
271
+ - lib/gorgon_bunny/lib/gorgon_bunny/consumer_work_pool.rb
272
+ - lib/gorgon_bunny/lib/gorgon_bunny/delivery_info.rb
273
+ - lib/gorgon_bunny/lib/gorgon_bunny/exceptions.rb
274
+ - lib/gorgon_bunny/lib/gorgon_bunny/exchange.rb
275
+ - lib/gorgon_bunny/lib/gorgon_bunny/framing.rb
276
+ - lib/gorgon_bunny/lib/gorgon_bunny/heartbeat_sender.rb
277
+ - lib/gorgon_bunny/lib/gorgon_bunny/message_properties.rb
278
+ - lib/gorgon_bunny/lib/gorgon_bunny/queue.rb
279
+ - lib/gorgon_bunny/lib/gorgon_bunny/reader_loop.rb
280
+ - lib/gorgon_bunny/lib/gorgon_bunny/return_info.rb
281
+ - lib/gorgon_bunny/lib/gorgon_bunny/session.rb
282
+ - lib/gorgon_bunny/lib/gorgon_bunny/socket.rb
283
+ - lib/gorgon_bunny/lib/gorgon_bunny/ssl_socket.rb
284
+ - lib/gorgon_bunny/lib/gorgon_bunny/system_timer.rb
285
+ - lib/gorgon_bunny/lib/gorgon_bunny/test_kit.rb
286
+ - lib/gorgon_bunny/lib/gorgon_bunny/timeout.rb
287
+ - lib/gorgon_bunny/lib/gorgon_bunny/transport.rb
288
+ - lib/gorgon_bunny/lib/gorgon_bunny/version.rb
289
+ - lib/gorgon_bunny/lib/gorgon_bunny/versioned_delivery_tag.rb
251
290
  - spec/callback_handler_spec.rb
252
291
  - spec/crash_reporter_spec.rb
253
292
  - spec/failures_printer_spec.rb