protobuf 2.7.11-java → 2.8.0.beta1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/README.md +39 -2
  2. data/lib/protobuf.rb +17 -26
  3. data/lib/protobuf/cli.rb +106 -86
  4. data/lib/protobuf/field/float_field.rb +5 -1
  5. data/lib/protobuf/rpc/connectors/base.rb +1 -1
  6. data/lib/protobuf/rpc/connectors/zmq.rb +157 -29
  7. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +49 -0
  8. data/lib/protobuf/rpc/error/client_error.rb +5 -5
  9. data/lib/protobuf/rpc/error/server_error.rb +7 -7
  10. data/lib/protobuf/rpc/rpc.pb.rb +13 -12
  11. data/lib/protobuf/rpc/servers/evented_runner.rb +11 -6
  12. data/lib/protobuf/rpc/servers/socket/server.rb +19 -15
  13. data/lib/protobuf/rpc/servers/socket_runner.rb +21 -18
  14. data/lib/protobuf/rpc/servers/zmq/broker.rb +104 -94
  15. data/lib/protobuf/rpc/servers/zmq/server.rb +263 -43
  16. data/lib/protobuf/rpc/servers/zmq/util.rb +18 -6
  17. data/lib/protobuf/rpc/servers/zmq/worker.rb +102 -39
  18. data/lib/protobuf/rpc/servers/zmq_runner.rb +31 -20
  19. data/lib/protobuf/rpc/service.rb +24 -12
  20. data/lib/protobuf/rpc/service_directory.rb +206 -0
  21. data/lib/protobuf/rpc/stat.rb +1 -1
  22. data/lib/protobuf/version.rb +1 -1
  23. data/proto/dynamic_discovery.proto +44 -0
  24. data/spec/benchmark/tasks.rb +1 -3
  25. data/spec/functional/socket_server_spec.rb +6 -5
  26. data/spec/functional/zmq_server_spec.rb +59 -30
  27. data/spec/lib/protobuf/cli_spec.rb +49 -54
  28. data/spec/lib/protobuf/enum_spec.rb +1 -1
  29. data/spec/lib/protobuf/rpc/client_spec.rb +1 -1
  30. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +43 -1
  31. data/spec/lib/protobuf/rpc/servers/evented_server_spec.rb +2 -1
  32. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +9 -8
  33. data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +24 -19
  34. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +5 -5
  35. data/spec/lib/protobuf/rpc/service_directory_spec.rb +183 -0
  36. data/spec/support/server.rb +21 -12
  37. data/spec/support/test/resource.pb.rb +6 -0
  38. data/spec/support/test/resource.proto +5 -0
  39. data/spec/support/test/resource_service.rb +7 -0
  40. metadata +11 -11
  41. data/spec/lib/protobuf/rpc/servers/zmq/broker_spec.rb +0 -31
@@ -21,6 +21,7 @@ module Test
21
21
  # Message Classes
22
22
  #
23
23
  class ResourceFindRequest < ::Protobuf::Message; end
24
+ class ResourceSleepRequest < ::Protobuf::Message; end
24
25
  class Resource < ::Protobuf::Message; end
25
26
  class Searchable < ::Protobuf::Message
26
27
  class SearchType < ::Protobuf::Enum
@@ -44,6 +45,10 @@ module Test
44
45
  optional ::Protobuf::Field::BoolField, :active, 2
45
46
  end
46
47
 
48
+ class ResourceSleepRequest
49
+ optional ::Protobuf::Field::Int32Field, :sleep, 1
50
+ end
51
+
47
52
  class Resource
48
53
  required ::Protobuf::Field::StringField, :name, 1
49
54
  optional ::Protobuf::Field::Int64Field, :date_created, 2
@@ -93,6 +98,7 @@ module Test
93
98
  #
94
99
  class ResourceService < ::Protobuf::Rpc::Service
95
100
  rpc :find, ::Test::ResourceFindRequest, ::Test::Resource
101
+ rpc :find_with_sleep, ::Test::ResourceSleepRequest, ::Test::Resource
96
102
  end
97
103
  end
98
104
 
@@ -12,6 +12,10 @@ message ResourceFindRequest {
12
12
  optional bool active = 2;
13
13
  }
14
14
 
15
+ message ResourceSleepRequest {
16
+ optional int32 sleep = 1;
17
+ }
18
+
15
19
  message Resource {
16
20
  extensions 100 to max;
17
21
 
@@ -78,4 +82,5 @@ extend Nested.NestedLevelOne {
78
82
 
79
83
  service ResourceService {
80
84
  rpc Find (ResourceFindRequest) returns (Resource);
85
+ rpc FindWithSleep (ResourceSleepRequest) returns (Resource);
81
86
  }
@@ -10,5 +10,12 @@ module Test
10
10
  response.status = request.active ? 1 : 0
11
11
  end
12
12
 
13
+ # request -> Test::ResourceSleepRequest
14
+ # response -> Test::Resource
15
+ def find_with_sleep
16
+ sleep (request.sleep || 1)
17
+ response.name = 'Request should have timed out'
18
+ end
19
+
13
20
  end
14
21
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 2.7.11
4
+ prerelease: 6
5
+ version: 2.8.0.beta1
6
6
  platform: java
7
7
  authors:
8
8
  - BJ Neilsen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-06-17 00:00:00.000000000 Z
13
+ date: 2013-06-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -404,6 +404,7 @@ files:
404
404
  - lib/protobuf/rpc/connectors/eventmachine.rb
405
405
  - lib/protobuf/rpc/connectors/socket.rb
406
406
  - lib/protobuf/rpc/connectors/zmq.rb
407
+ - lib/protobuf/rpc/dynamic_discovery.pb.rb
407
408
  - lib/protobuf/rpc/error.rb
408
409
  - lib/protobuf/rpc/error/client_error.rb
409
410
  - lib/protobuf/rpc/error/server_error.rb
@@ -420,6 +421,7 @@ files:
420
421
  - lib/protobuf/rpc/servers/zmq/worker.rb
421
422
  - lib/protobuf/rpc/servers/zmq_runner.rb
422
423
  - lib/protobuf/rpc/service.rb
424
+ - lib/protobuf/rpc/service_directory.rb
423
425
  - lib/protobuf/rpc/service_dispatcher.rb
424
426
  - lib/protobuf/rpc/service_filters.rb
425
427
  - lib/protobuf/rpc/stat.rb
@@ -427,6 +429,7 @@ files:
427
429
  - lib/protobuf/version.rb
428
430
  - lib/protobuf/wire_type.rb
429
431
  - lib/protobuf/zmq.rb
432
+ - proto/dynamic_discovery.proto
430
433
  - proto/rpc.proto
431
434
  - protobuf.gemspec
432
435
  - spec/benchmark/tasks.rb
@@ -448,10 +451,10 @@ files:
448
451
  - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
449
452
  - spec/lib/protobuf/rpc/servers/evented_server_spec.rb
450
453
  - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
451
- - spec/lib/protobuf/rpc/servers/zmq/broker_spec.rb
452
454
  - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
453
455
  - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
454
456
  - spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
457
+ - spec/lib/protobuf/rpc/service_directory_spec.rb
455
458
  - spec/lib/protobuf/rpc/service_dispatcher_spec.rb
456
459
  - spec/lib/protobuf/rpc/service_filters_spec.rb
457
460
  - spec/lib/protobuf/rpc/service_spec.rb
@@ -532,13 +535,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
532
535
  none: false
533
536
  required_rubygems_version: !ruby/object:Gem::Requirement
534
537
  requirements:
535
- - - ">="
538
+ - - !binary |-
539
+ Pg==
536
540
  - !ruby/object:Gem::Version
537
- segments:
538
- - 0
539
- hash: 2
540
- version: !binary |-
541
- MA==
541
+ version: 1.3.1
542
542
  none: false
543
543
  requirements: []
544
544
  rubyforge_project:
@@ -566,10 +566,10 @@ test_files:
566
566
  - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
567
567
  - spec/lib/protobuf/rpc/servers/evented_server_spec.rb
568
568
  - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
569
- - spec/lib/protobuf/rpc/servers/zmq/broker_spec.rb
570
569
  - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
571
570
  - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
572
571
  - spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
572
+ - spec/lib/protobuf/rpc/service_directory_spec.rb
573
573
  - spec/lib/protobuf/rpc/service_dispatcher_spec.rb
574
574
  - spec/lib/protobuf/rpc/service_filters_spec.rb
575
575
  - spec/lib/protobuf/rpc/service_spec.rb
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ::Protobuf::Rpc::Zmq::Broker do
4
- before(:each) do
5
- load 'protobuf/zmq.rb'
6
- end
7
-
8
- after(:each) do
9
- subject.teardown
10
- end
11
-
12
- subject do
13
- described_class.new({ :host => '127.0.0.1', :port => 9399, :worker_port => 9400 })
14
- end
15
-
16
- it 'sets up a context' do
17
- subject.context.should be_a(::ZMQ::Context)
18
- end
19
-
20
- it 'sets up a backend socket' do
21
- subject.backend.should be_a(::ZMQ::Socket)
22
- end
23
-
24
- it 'sets up a polling object' do
25
- subject.poller.should be_a(::ZMQ::Poller)
26
- end
27
-
28
- describe '#poll' do
29
- # no unit tests for this method
30
- end
31
- end