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.
- data/README.md +39 -2
- data/lib/protobuf.rb +17 -26
- data/lib/protobuf/cli.rb +106 -86
- data/lib/protobuf/field/bytes_field.rb +6 -8
- data/lib/protobuf/field/float_field.rb +5 -1
- data/lib/protobuf/field/string_field.rb +7 -8
- data/lib/protobuf/rpc/connectors/base.rb +1 -1
- data/lib/protobuf/rpc/connectors/zmq.rb +157 -29
- data/lib/protobuf/rpc/dynamic_discovery.pb.rb +49 -0
- data/lib/protobuf/rpc/error/client_error.rb +5 -5
- data/lib/protobuf/rpc/error/server_error.rb +7 -7
- data/lib/protobuf/rpc/rpc.pb.rb +13 -12
- data/lib/protobuf/rpc/servers/evented_runner.rb +11 -6
- data/lib/protobuf/rpc/servers/socket/server.rb +19 -15
- data/lib/protobuf/rpc/servers/socket_runner.rb +21 -18
- data/lib/protobuf/rpc/servers/zmq/broker.rb +104 -94
- data/lib/protobuf/rpc/servers/zmq/server.rb +263 -43
- data/lib/protobuf/rpc/servers/zmq/util.rb +18 -6
- data/lib/protobuf/rpc/servers/zmq/worker.rb +102 -39
- data/lib/protobuf/rpc/servers/zmq_runner.rb +31 -20
- data/lib/protobuf/rpc/service.rb +24 -12
- data/lib/protobuf/rpc/service_directory.rb +206 -0
- data/lib/protobuf/rpc/stat.rb +1 -1
- data/lib/protobuf/version.rb +1 -1
- data/proto/dynamic_discovery.proto +44 -0
- data/spec/benchmark/tasks.rb +1 -3
- data/spec/functional/socket_server_spec.rb +6 -5
- data/spec/functional/zmq_server_spec.rb +59 -30
- data/spec/lib/protobuf/cli_spec.rb +49 -54
- data/spec/lib/protobuf/enum_spec.rb +1 -1
- data/spec/lib/protobuf/rpc/client_spec.rb +1 -1
- data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +43 -1
- data/spec/lib/protobuf/rpc/servers/evented_server_spec.rb +2 -1
- data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +9 -8
- data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +24 -19
- data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +5 -5
- data/spec/lib/protobuf/rpc/service_directory_spec.rb +183 -0
- data/spec/support/server.rb +21 -12
- data/spec/support/test/resource.pb.rb +6 -0
- data/spec/support/test/resource.proto +5 -0
- data/spec/support/test/resource_service.rb +7 -0
- metadata +70 -38
- checksums.yaml +0 -7
- data/spec/lib/protobuf/field/string_field_spec.rb +0 -46
- 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
|