protobuf 2.7.12 → 2.8.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) 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/bytes_field.rb +6 -8
  5. data/lib/protobuf/field/float_field.rb +5 -1
  6. data/lib/protobuf/field/string_field.rb +7 -8
  7. data/lib/protobuf/rpc/connectors/base.rb +1 -1
  8. data/lib/protobuf/rpc/connectors/zmq.rb +157 -29
  9. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +49 -0
  10. data/lib/protobuf/rpc/error/client_error.rb +5 -5
  11. data/lib/protobuf/rpc/error/server_error.rb +7 -7
  12. data/lib/protobuf/rpc/rpc.pb.rb +13 -12
  13. data/lib/protobuf/rpc/servers/evented_runner.rb +11 -6
  14. data/lib/protobuf/rpc/servers/socket/server.rb +19 -15
  15. data/lib/protobuf/rpc/servers/socket_runner.rb +21 -18
  16. data/lib/protobuf/rpc/servers/zmq/broker.rb +104 -94
  17. data/lib/protobuf/rpc/servers/zmq/server.rb +263 -43
  18. data/lib/protobuf/rpc/servers/zmq/util.rb +18 -6
  19. data/lib/protobuf/rpc/servers/zmq/worker.rb +102 -39
  20. data/lib/protobuf/rpc/servers/zmq_runner.rb +31 -20
  21. data/lib/protobuf/rpc/service.rb +24 -12
  22. data/lib/protobuf/rpc/service_directory.rb +206 -0
  23. data/lib/protobuf/rpc/stat.rb +1 -1
  24. data/lib/protobuf/version.rb +1 -1
  25. data/proto/dynamic_discovery.proto +44 -0
  26. data/spec/benchmark/tasks.rb +1 -3
  27. data/spec/functional/socket_server_spec.rb +6 -5
  28. data/spec/functional/zmq_server_spec.rb +59 -30
  29. data/spec/lib/protobuf/cli_spec.rb +49 -54
  30. data/spec/lib/protobuf/enum_spec.rb +1 -1
  31. data/spec/lib/protobuf/rpc/client_spec.rb +1 -1
  32. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +43 -1
  33. data/spec/lib/protobuf/rpc/servers/evented_server_spec.rb +2 -1
  34. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +9 -8
  35. data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +24 -19
  36. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +5 -5
  37. data/spec/lib/protobuf/rpc/service_directory_spec.rb +183 -0
  38. data/spec/support/server.rb +21 -12
  39. data/spec/support/test/resource.pb.rb +6 -0
  40. data/spec/support/test/resource.proto +5 -0
  41. data/spec/support/test/resource_service.rb +7 -0
  42. metadata +70 -38
  43. checksums.yaml +0 -7
  44. data/spec/lib/protobuf/field/string_field_spec.rb +0 -46
  45. data/spec/lib/protobuf/rpc/servers/zmq/broker_spec.rb +0 -31
@@ -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