protobuf 2.6.5 → 2.6.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ require 'timeout'
1
2
  require 'protobuf/logger'
2
3
  require 'protobuf/rpc/rpc.pb'
3
4
  require 'protobuf/rpc/buffer'
@@ -16,7 +17,7 @@ module Protobuf
16
17
  :request => nil, # The request object sent by the client
17
18
  :request_type => nil, # The request type expected by the client
18
19
  :response_type => nil, # The response type expected by the client
19
- :timeout => 30, # The default timeout for the request, also handled by client.rb
20
+ :timeout => 300, # The default timeout for the request, also handled by client.rb
20
21
  :client_host => nil # The hostname or address of this client
21
22
  }
22
23
 
@@ -135,6 +135,14 @@ module Protobuf
135
135
  complete
136
136
  end
137
137
 
138
+ # Wrap the given block in a timeout of the configured number of seconds.
139
+ #
140
+ def timeout_wrap(&block)
141
+ ::Timeout.timeout(options[:timeout], &block)
142
+ rescue ::Timeout::Error => e
143
+ fail(:RPC_FAILED, "The server took longer than #{options[:timeout]} seconds to respond")
144
+ end
145
+
138
146
  def validate_request_type!
139
147
  unless @options[:request].class == @options[:request_type]
140
148
  expected = @options[:request_type].name
@@ -8,10 +8,14 @@ module Protobuf
8
8
  include Protobuf::Logger::LogMethods
9
9
 
10
10
  def send_request
11
- setup_connection
12
- connect_to_rpc_server
13
- post_init
14
- read_response
11
+ timeout_wrap do
12
+ setup_connection
13
+ connect_to_rpc_server
14
+ post_init
15
+ read_response
16
+ end
17
+ ensure
18
+ @socket.close unless @socket.closed?
15
19
  end
16
20
 
17
21
  def log_signature
@@ -8,10 +8,12 @@ module Protobuf
8
8
  include Protobuf::Logger::LogMethods
9
9
 
10
10
  def send_request
11
- setup_connection
12
- connect_to_rpc_server
13
- post_init
14
- read_response
11
+ timeout_wrap do
12
+ setup_connection
13
+ connect_to_rpc_server
14
+ post_init
15
+ read_response
16
+ end
15
17
  ensure
16
18
  @socket.close if @socket
17
19
  @zmq_context.terminate if @zmq_context
@@ -1,4 +1,4 @@
1
1
  module Protobuf
2
- VERSION = '2.6.5'
2
+ VERSION = '2.6.6'
3
3
  PROTOC_VERSION = '2.4.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.5
4
+ version: 2.6.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-09 00:00:00.000000000 Z
13
+ date: 2013-02-18 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
- requirement: !ruby/object:Gem::Requirement
17
+ requirement: &2152238200 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,15 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ! '>='
29
- - !ruby/object:Gem::Version
30
- version: '0'
25
+ version_requirements: *2152238200
31
26
  - !ruby/object:Gem::Dependency
32
27
  name: ffi
33
- requirement: !ruby/object:Gem::Requirement
28
+ requirement: &2152234620 !ruby/object:Gem::Requirement
34
29
  none: false
35
30
  requirements:
36
31
  - - ! '>='
@@ -38,15 +33,10 @@ dependencies:
38
33
  version: '0'
39
34
  type: :runtime
40
35
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
36
+ version_requirements: *2152234620
47
37
  - !ruby/object:Gem::Dependency
48
38
  name: multi_json
49
- requirement: !ruby/object:Gem::Requirement
39
+ requirement: &2152232860 !ruby/object:Gem::Requirement
50
40
  none: false
51
41
  requirements:
52
42
  - - ! '>='
@@ -54,15 +44,10 @@ dependencies:
54
44
  version: '0'
55
45
  type: :runtime
56
46
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
47
+ version_requirements: *2152232860
63
48
  - !ruby/object:Gem::Dependency
64
49
  name: thor
65
- requirement: !ruby/object:Gem::Requirement
50
+ requirement: &2152230460 !ruby/object:Gem::Requirement
66
51
  none: false
67
52
  requirements:
68
53
  - - ! '>='
@@ -70,15 +55,10 @@ dependencies:
70
55
  version: '0'
71
56
  type: :runtime
72
57
  prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
58
+ version_requirements: *2152230460
79
59
  - !ruby/object:Gem::Dependency
80
60
  name: eventmachine
81
- requirement: !ruby/object:Gem::Requirement
61
+ requirement: &2152223420 !ruby/object:Gem::Requirement
82
62
  none: false
83
63
  requirements:
84
64
  - - ! '>='
@@ -86,15 +66,10 @@ dependencies:
86
66
  version: '0'
87
67
  type: :development
88
68
  prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ! '>='
93
- - !ruby/object:Gem::Version
94
- version: '0'
69
+ version_requirements: *2152223420
95
70
  - !ruby/object:Gem::Dependency
96
71
  name: ffi-rzmq
97
- requirement: !ruby/object:Gem::Requirement
72
+ requirement: &2152220000 !ruby/object:Gem::Requirement
98
73
  none: false
99
74
  requirements:
100
75
  - - ! '>='
@@ -102,15 +77,10 @@ dependencies:
102
77
  version: '0'
103
78
  type: :development
104
79
  prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
80
+ version_requirements: *2152220000
111
81
  - !ruby/object:Gem::Dependency
112
82
  name: pry
113
- requirement: !ruby/object:Gem::Requirement
83
+ requirement: &2152217940 !ruby/object:Gem::Requirement
114
84
  none: false
115
85
  requirements:
116
86
  - - ! '>='
@@ -118,15 +88,10 @@ dependencies:
118
88
  version: '0'
119
89
  type: :development
120
90
  prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - ! '>='
125
- - !ruby/object:Gem::Version
126
- version: '0'
91
+ version_requirements: *2152217940
127
92
  - !ruby/object:Gem::Dependency
128
93
  name: pry-nav
129
- requirement: !ruby/object:Gem::Requirement
94
+ requirement: &2152151840 !ruby/object:Gem::Requirement
130
95
  none: false
131
96
  requirements:
132
97
  - - ! '>='
@@ -134,15 +99,10 @@ dependencies:
134
99
  version: '0'
135
100
  type: :development
136
101
  prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ! '>='
141
- - !ruby/object:Gem::Version
142
- version: '0'
102
+ version_requirements: *2152151840
143
103
  - !ruby/object:Gem::Dependency
144
104
  name: rake
145
- requirement: !ruby/object:Gem::Requirement
105
+ requirement: &2152145500 !ruby/object:Gem::Requirement
146
106
  none: false
147
107
  requirements:
148
108
  - - ! '>='
@@ -150,15 +110,10 @@ dependencies:
150
110
  version: '0'
151
111
  type: :development
152
112
  prerelease: false
153
- version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
- requirements:
156
- - - ! '>='
157
- - !ruby/object:Gem::Version
158
- version: '0'
113
+ version_requirements: *2152145500
159
114
  - !ruby/object:Gem::Dependency
160
115
  name: rake-compiler
161
- requirement: !ruby/object:Gem::Requirement
116
+ requirement: &2152142160 !ruby/object:Gem::Requirement
162
117
  none: false
163
118
  requirements:
164
119
  - - ! '>='
@@ -166,15 +121,10 @@ dependencies:
166
121
  version: '0'
167
122
  type: :development
168
123
  prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - ! '>='
173
- - !ruby/object:Gem::Version
174
- version: '0'
124
+ version_requirements: *2152142160
175
125
  - !ruby/object:Gem::Dependency
176
126
  name: rspec
177
- requirement: !ruby/object:Gem::Requirement
127
+ requirement: &2152137800 !ruby/object:Gem::Requirement
178
128
  none: false
179
129
  requirements:
180
130
  - - ! '>='
@@ -182,15 +132,10 @@ dependencies:
182
132
  version: '0'
183
133
  type: :development
184
134
  prerelease: false
185
- version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
- requirements:
188
- - - ! '>='
189
- - !ruby/object:Gem::Version
190
- version: '0'
135
+ version_requirements: *2152137800
191
136
  - !ruby/object:Gem::Dependency
192
137
  name: simplecov
193
- requirement: !ruby/object:Gem::Requirement
138
+ requirement: &2152132580 !ruby/object:Gem::Requirement
194
139
  none: false
195
140
  requirements:
196
141
  - - ! '>='
@@ -198,15 +143,10 @@ dependencies:
198
143
  version: '0'
199
144
  type: :development
200
145
  prerelease: false
201
- version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
- requirements:
204
- - - ! '>='
205
- - !ruby/object:Gem::Version
206
- version: '0'
146
+ version_requirements: *2152132580
207
147
  - !ruby/object:Gem::Dependency
208
148
  name: yard
209
- requirement: !ruby/object:Gem::Requirement
149
+ requirement: &2152124600 !ruby/object:Gem::Requirement
210
150
  none: false
211
151
  requirements:
212
152
  - - ! '>='
@@ -214,12 +154,7 @@ dependencies:
214
154
  version: '0'
215
155
  type: :development
216
156
  prerelease: false
217
- version_requirements: !ruby/object:Gem::Requirement
218
- none: false
219
- requirements:
220
- - - ! '>='
221
- - !ruby/object:Gem::Version
222
- version: '0'
157
+ version_requirements: *2152124600
223
158
  description: Google Protocol Buffers v2.4.1 Serialization and RPC implementation for
224
159
  Ruby.
225
160
  email:
@@ -499,7 +434,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
499
434
  version: '0'
500
435
  segments:
501
436
  - 0
502
- hash: -2629785281422832728
437
+ hash: -4295653225771517786
503
438
  required_rubygems_version: !ruby/object:Gem::Requirement
504
439
  none: false
505
440
  requirements:
@@ -508,12 +443,93 @@ required_rubygems_version: !ruby/object:Gem::Requirement
508
443
  version: '0'
509
444
  segments:
510
445
  - 0
511
- hash: -2629785281422832728
446
+ hash: -4295653225771517786
512
447
  requirements: []
513
448
  rubyforge_project:
514
- rubygems_version: 1.8.24
449
+ rubygems_version: 1.8.15
515
450
  signing_key:
516
451
  specification_version: 3
517
452
  summary: Google Protocol Buffers v2.4.1 Serialization and RPC implementation for Ruby.
518
- test_files: []
453
+ test_files:
454
+ - spec/benchmark/tasks.rb
455
+ - spec/functional/embedded_service_spec.rb
456
+ - spec/functional/evented_server_spec.rb
457
+ - spec/functional/socket_server_spec.rb
458
+ - spec/functional/zmq_server_spec.rb
459
+ - spec/lib/protobuf/cli_spec.rb
460
+ - spec/lib/protobuf/enum_spec.rb
461
+ - spec/lib/protobuf/enum_value_spec.rb
462
+ - spec/lib/protobuf/field/int32_field_spec.rb
463
+ - spec/lib/protobuf/logger_spec.rb
464
+ - spec/lib/protobuf/message_spec.rb
465
+ - spec/lib/protobuf/rpc/client_spec.rb
466
+ - spec/lib/protobuf/rpc/connector_spec.rb
467
+ - spec/lib/protobuf/rpc/connectors/base_spec.rb
468
+ - spec/lib/protobuf/rpc/connectors/common_spec.rb
469
+ - spec/lib/protobuf/rpc/connectors/socket_spec.rb
470
+ - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
471
+ - spec/lib/protobuf/rpc/servers/evented_server_spec.rb
472
+ - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
473
+ - spec/lib/protobuf/rpc/servers/zmq/broker_spec.rb
474
+ - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
475
+ - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
476
+ - spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
477
+ - spec/lib/protobuf/rpc/service_dispatcher_spec.rb
478
+ - spec/lib/protobuf/rpc/service_filters_spec.rb
479
+ - spec/lib/protobuf/rpc/service_spec.rb
480
+ - spec/lib/protobuf_spec.rb
481
+ - spec/spec_helper.rb
482
+ - spec/support/all.rb
483
+ - spec/support/packed_field.rb
484
+ - spec/support/server.rb
485
+ - spec/support/test/enum.pb.rb
486
+ - spec/support/test/enum.proto
487
+ - spec/support/test/resource.pb.rb
488
+ - spec/support/test/resource.proto
489
+ - spec/support/test/resource_service.rb
490
+ - spec/support/test_app_file.rb
491
+ - spec/support/tolerance_matcher.rb
492
+ - test/data/data.bin
493
+ - test/data/data_source.py
494
+ - test/data/types.bin
495
+ - test/data/types_source.py
496
+ - test/data/unk.png
497
+ - test/proto/addressbook.pb.rb
498
+ - test/proto/addressbook.proto
499
+ - test/proto/addressbook_base.pb.rb
500
+ - test/proto/addressbook_base.proto
501
+ - test/proto/addressbook_ext.pb.rb
502
+ - test/proto/addressbook_ext.proto
503
+ - test/proto/collision.pb.rb
504
+ - test/proto/collision.proto
505
+ - test/proto/ext_collision.pb.rb
506
+ - test/proto/ext_collision.proto
507
+ - test/proto/ext_range.pb.rb
508
+ - test/proto/ext_range.proto
509
+ - test/proto/float_default.proto
510
+ - test/proto/lowercase.pb.rb
511
+ - test/proto/lowercase.proto
512
+ - test/proto/merge.pb.rb
513
+ - test/proto/merge.proto
514
+ - test/proto/nested.pb.rb
515
+ - test/proto/nested.proto
516
+ - test/proto/optional_field.pb.rb
517
+ - test/proto/optional_field.proto
518
+ - test/proto/packed.pb.rb
519
+ - test/proto/packed.proto
520
+ - test/proto/rpc.proto
521
+ - test/proto/types.pb.rb
522
+ - test/proto/types.proto
523
+ - test/test_addressbook.rb
524
+ - test/test_enum_value.rb
525
+ - test/test_extension.rb
526
+ - test/test_lowercase.rb
527
+ - test/test_message.rb
528
+ - test/test_optional_field.rb
529
+ - test/test_packed_field.rb
530
+ - test/test_parse.rb
531
+ - test/test_repeated_types.rb
532
+ - test/test_serialize.rb
533
+ - test/test_standard_message.rb
534
+ - test/test_types.rb
519
535
  has_rdoc: