protobuf 2.6.5-java → 2.6.6-java

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
@@ -2,7 +2,7 @@
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.6.5
5
+ version: 2.6.6
6
6
  platform: java
7
7
  authors:
8
8
  - BJ Neilsen
@@ -10,240 +10,149 @@ 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
- version_requirements: !ruby/object:Gem::Requirement
17
+ version_requirements: &5666 !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: !binary |-
22
- MA==
23
- none: false
24
- requirement: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- version: !binary |-
29
- MA==
21
+ version: '0'
30
22
  none: false
23
+ requirement: *5666
31
24
  prerelease: false
32
25
  type: :runtime
33
26
  - !ruby/object:Gem::Dependency
34
27
  name: ffi
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: !binary |-
40
- MA==
41
- none: false
42
- requirement: !ruby/object:Gem::Requirement
28
+ version_requirements: &5684 !ruby/object:Gem::Requirement
43
29
  requirements:
44
- - - ">="
30
+ - - ! '>='
45
31
  - !ruby/object:Gem::Version
46
- version: !binary |-
47
- MA==
32
+ version: '0'
48
33
  none: false
34
+ requirement: *5684
49
35
  prerelease: false
50
36
  type: :runtime
51
37
  - !ruby/object:Gem::Dependency
52
38
  name: multi_json
53
- version_requirements: !ruby/object:Gem::Requirement
39
+ version_requirements: &5700 !ruby/object:Gem::Requirement
54
40
  requirements:
55
- - - ">="
41
+ - - ! '>='
56
42
  - !ruby/object:Gem::Version
57
- version: !binary |-
58
- MA==
59
- none: false
60
- requirement: !ruby/object:Gem::Requirement
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: !binary |-
65
- MA==
43
+ version: '0'
66
44
  none: false
45
+ requirement: *5700
67
46
  prerelease: false
68
47
  type: :runtime
69
48
  - !ruby/object:Gem::Dependency
70
49
  name: thor
71
- version_requirements: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: !binary |-
76
- MA==
77
- none: false
78
- requirement: !ruby/object:Gem::Requirement
50
+ version_requirements: &5716 !ruby/object:Gem::Requirement
79
51
  requirements:
80
- - - ">="
52
+ - - ! '>='
81
53
  - !ruby/object:Gem::Version
82
- version: !binary |-
83
- MA==
54
+ version: '0'
84
55
  none: false
56
+ requirement: *5716
85
57
  prerelease: false
86
58
  type: :runtime
87
59
  - !ruby/object:Gem::Dependency
88
60
  name: eventmachine
89
- version_requirements: !ruby/object:Gem::Requirement
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- version: !binary |-
94
- MA==
95
- none: false
96
- requirement: !ruby/object:Gem::Requirement
61
+ version_requirements: &5732 !ruby/object:Gem::Requirement
97
62
  requirements:
98
- - - ">="
63
+ - - ! '>='
99
64
  - !ruby/object:Gem::Version
100
- version: !binary |-
101
- MA==
65
+ version: '0'
102
66
  none: false
67
+ requirement: *5732
103
68
  prerelease: false
104
69
  type: :development
105
70
  - !ruby/object:Gem::Dependency
106
71
  name: ffi-rzmq
107
- version_requirements: !ruby/object:Gem::Requirement
72
+ version_requirements: &5750 !ruby/object:Gem::Requirement
108
73
  requirements:
109
- - - ">="
74
+ - - ! '>='
110
75
  - !ruby/object:Gem::Version
111
- version: !binary |-
112
- MA==
113
- none: false
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: !binary |-
119
- MA==
76
+ version: '0'
120
77
  none: false
78
+ requirement: *5750
121
79
  prerelease: false
122
80
  type: :development
123
81
  - !ruby/object:Gem::Dependency
124
82
  name: pry
125
- version_requirements: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- version: !binary |-
130
- MA==
131
- none: false
132
- requirement: !ruby/object:Gem::Requirement
83
+ version_requirements: &5766 !ruby/object:Gem::Requirement
133
84
  requirements:
134
- - - ">="
85
+ - - ! '>='
135
86
  - !ruby/object:Gem::Version
136
- version: !binary |-
137
- MA==
87
+ version: '0'
138
88
  none: false
89
+ requirement: *5766
139
90
  prerelease: false
140
91
  type: :development
141
92
  - !ruby/object:Gem::Dependency
142
93
  name: pry-nav
143
- version_requirements: !ruby/object:Gem::Requirement
94
+ version_requirements: &5782 !ruby/object:Gem::Requirement
144
95
  requirements:
145
- - - ">="
96
+ - - ! '>='
146
97
  - !ruby/object:Gem::Version
147
- version: !binary |-
148
- MA==
149
- none: false
150
- requirement: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: !binary |-
155
- MA==
98
+ version: '0'
156
99
  none: false
100
+ requirement: *5782
157
101
  prerelease: false
158
102
  type: :development
159
103
  - !ruby/object:Gem::Dependency
160
104
  name: rake
161
- version_requirements: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: !binary |-
166
- MA==
167
- none: false
168
- requirement: !ruby/object:Gem::Requirement
105
+ version_requirements: &5798 !ruby/object:Gem::Requirement
169
106
  requirements:
170
- - - ">="
107
+ - - ! '>='
171
108
  - !ruby/object:Gem::Version
172
- version: !binary |-
173
- MA==
109
+ version: '0'
174
110
  none: false
111
+ requirement: *5798
175
112
  prerelease: false
176
113
  type: :development
177
114
  - !ruby/object:Gem::Dependency
178
115
  name: rake-compiler
179
- version_requirements: !ruby/object:Gem::Requirement
180
- requirements:
181
- - - ">="
182
- - !ruby/object:Gem::Version
183
- version: !binary |-
184
- MA==
185
- none: false
186
- requirement: !ruby/object:Gem::Requirement
116
+ version_requirements: &5814 !ruby/object:Gem::Requirement
187
117
  requirements:
188
- - - ">="
118
+ - - ! '>='
189
119
  - !ruby/object:Gem::Version
190
- version: !binary |-
191
- MA==
120
+ version: '0'
192
121
  none: false
122
+ requirement: *5814
193
123
  prerelease: false
194
124
  type: :development
195
125
  - !ruby/object:Gem::Dependency
196
126
  name: rspec
197
- version_requirements: !ruby/object:Gem::Requirement
127
+ version_requirements: &5830 !ruby/object:Gem::Requirement
198
128
  requirements:
199
- - - ">="
129
+ - - ! '>='
200
130
  - !ruby/object:Gem::Version
201
- version: !binary |-
202
- MA==
203
- none: false
204
- requirement: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: !binary |-
209
- MA==
131
+ version: '0'
210
132
  none: false
133
+ requirement: *5830
211
134
  prerelease: false
212
135
  type: :development
213
136
  - !ruby/object:Gem::Dependency
214
137
  name: simplecov
215
- version_requirements: !ruby/object:Gem::Requirement
216
- requirements:
217
- - - ">="
218
- - !ruby/object:Gem::Version
219
- version: !binary |-
220
- MA==
221
- none: false
222
- requirement: !ruby/object:Gem::Requirement
138
+ version_requirements: &5846 !ruby/object:Gem::Requirement
223
139
  requirements:
224
- - - ">="
140
+ - - ! '>='
225
141
  - !ruby/object:Gem::Version
226
- version: !binary |-
227
- MA==
142
+ version: '0'
228
143
  none: false
144
+ requirement: *5846
229
145
  prerelease: false
230
146
  type: :development
231
147
  - !ruby/object:Gem::Dependency
232
148
  name: yard
233
- version_requirements: !ruby/object:Gem::Requirement
149
+ version_requirements: &5862 !ruby/object:Gem::Requirement
234
150
  requirements:
235
- - - ">="
151
+ - - ! '>='
236
152
  - !ruby/object:Gem::Version
237
- version: !binary |-
238
- MA==
239
- none: false
240
- requirement: !ruby/object:Gem::Requirement
241
- requirements:
242
- - - ">="
243
- - !ruby/object:Gem::Version
244
- version: !binary |-
245
- MA==
153
+ version: '0'
246
154
  none: false
155
+ requirement: *5862
247
156
  prerelease: false
248
157
  type: :development
249
158
  description: Google Protocol Buffers v2.4.1 Serialization and RPC implementation for Ruby.
@@ -256,9 +165,9 @@ executables:
256
165
  extensions: []
257
166
  extra_rdoc_files: []
258
167
  files:
259
- - ".gitignore"
260
- - ".travis.yml"
261
- - ".yardopts"
168
+ - .gitignore
169
+ - .travis.yml
170
+ - .yardopts
262
171
  - Gemfile
263
172
  - README.md
264
173
  - Rakefile
@@ -517,29 +426,109 @@ require_paths:
517
426
  - lib
518
427
  required_ruby_version: !ruby/object:Gem::Requirement
519
428
  requirements:
520
- - - ">="
429
+ - - ! '>='
521
430
  - !ruby/object:Gem::Version
522
431
  segments:
523
432
  - 0
524
433
  hash: 2
525
- version: !binary |-
526
- MA==
434
+ version: '0'
527
435
  none: false
528
436
  required_rubygems_version: !ruby/object:Gem::Requirement
529
437
  requirements:
530
- - - ">="
438
+ - - ! '>='
531
439
  - !ruby/object:Gem::Version
532
440
  segments:
533
441
  - 0
534
442
  hash: 2
535
- version: !binary |-
536
- MA==
443
+ version: '0'
537
444
  none: false
538
445
  requirements: []
539
446
  rubyforge_project:
540
- rubygems_version: 1.8.24
447
+ rubygems_version: 1.8.15
541
448
  signing_key:
542
449
  specification_version: 3
543
450
  summary: Google Protocol Buffers v2.4.1 Serialization and RPC implementation for Ruby.
544
- test_files: []
451
+ test_files:
452
+ - spec/benchmark/tasks.rb
453
+ - spec/functional/embedded_service_spec.rb
454
+ - spec/functional/evented_server_spec.rb
455
+ - spec/functional/socket_server_spec.rb
456
+ - spec/functional/zmq_server_spec.rb
457
+ - spec/lib/protobuf/cli_spec.rb
458
+ - spec/lib/protobuf/enum_spec.rb
459
+ - spec/lib/protobuf/enum_value_spec.rb
460
+ - spec/lib/protobuf/field/int32_field_spec.rb
461
+ - spec/lib/protobuf/logger_spec.rb
462
+ - spec/lib/protobuf/message_spec.rb
463
+ - spec/lib/protobuf/rpc/client_spec.rb
464
+ - spec/lib/protobuf/rpc/connector_spec.rb
465
+ - spec/lib/protobuf/rpc/connectors/base_spec.rb
466
+ - spec/lib/protobuf/rpc/connectors/common_spec.rb
467
+ - spec/lib/protobuf/rpc/connectors/socket_spec.rb
468
+ - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
469
+ - spec/lib/protobuf/rpc/servers/evented_server_spec.rb
470
+ - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
471
+ - spec/lib/protobuf/rpc/servers/zmq/broker_spec.rb
472
+ - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
473
+ - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
474
+ - spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
475
+ - spec/lib/protobuf/rpc/service_dispatcher_spec.rb
476
+ - spec/lib/protobuf/rpc/service_filters_spec.rb
477
+ - spec/lib/protobuf/rpc/service_spec.rb
478
+ - spec/lib/protobuf_spec.rb
479
+ - spec/spec_helper.rb
480
+ - spec/support/all.rb
481
+ - spec/support/packed_field.rb
482
+ - spec/support/server.rb
483
+ - spec/support/test/enum.pb.rb
484
+ - spec/support/test/enum.proto
485
+ - spec/support/test/resource.pb.rb
486
+ - spec/support/test/resource.proto
487
+ - spec/support/test/resource_service.rb
488
+ - spec/support/test_app_file.rb
489
+ - spec/support/tolerance_matcher.rb
490
+ - test/data/data.bin
491
+ - test/data/data_source.py
492
+ - test/data/types.bin
493
+ - test/data/types_source.py
494
+ - test/data/unk.png
495
+ - test/proto/addressbook.pb.rb
496
+ - test/proto/addressbook.proto
497
+ - test/proto/addressbook_base.pb.rb
498
+ - test/proto/addressbook_base.proto
499
+ - test/proto/addressbook_ext.pb.rb
500
+ - test/proto/addressbook_ext.proto
501
+ - test/proto/collision.pb.rb
502
+ - test/proto/collision.proto
503
+ - test/proto/ext_collision.pb.rb
504
+ - test/proto/ext_collision.proto
505
+ - test/proto/ext_range.pb.rb
506
+ - test/proto/ext_range.proto
507
+ - test/proto/float_default.proto
508
+ - test/proto/lowercase.pb.rb
509
+ - test/proto/lowercase.proto
510
+ - test/proto/merge.pb.rb
511
+ - test/proto/merge.proto
512
+ - test/proto/nested.pb.rb
513
+ - test/proto/nested.proto
514
+ - test/proto/optional_field.pb.rb
515
+ - test/proto/optional_field.proto
516
+ - test/proto/packed.pb.rb
517
+ - test/proto/packed.proto
518
+ - test/proto/rpc.proto
519
+ - test/proto/types.pb.rb
520
+ - test/proto/types.proto
521
+ - test/test_addressbook.rb
522
+ - test/test_enum_value.rb
523
+ - test/test_extension.rb
524
+ - test/test_lowercase.rb
525
+ - test/test_message.rb
526
+ - test/test_optional_field.rb
527
+ - test/test_packed_field.rb
528
+ - test/test_parse.rb
529
+ - test/test_repeated_types.rb
530
+ - test/test_serialize.rb
531
+ - test/test_standard_message.rb
532
+ - test/test_types.rb
545
533
  has_rdoc:
534
+ ...