grpc 1.0.0.pre2-x86-linux → 1.0.0-x86-linux

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7476192883c49a666b614454d5d2d4f77ad53da
4
- data.tar.gz: d4499d4388c394dc69601adf161f5170922bbada
3
+ metadata.gz: 507b321f4233fc3d6956a2c6903a9da51cfc0b62
4
+ data.tar.gz: caa183f60cea3f4b62b5d25f5a624429f5580a5b
5
5
  SHA512:
6
- metadata.gz: cbad5731e13fd80d98c22f7228f9ab58b47b6a19343ceb1248ff13122eaff49b53b5f5a833162e33670a92e33c005a7c164fe8e86eac7bab350962c36994783d
7
- data.tar.gz: 51f16367beccca70fed376b046053b3a5e554a1bc9f32ac6e24e665ed9439f5cbde9ef38a9778dbacdd4e76d2d9fb524335ba589548f3547ebd428ca5694f20c
6
+ metadata.gz: b6d3ca802974c8e1dcd2f27bd8374e428b58bf00cee8ebfe7dee268b97b067b9a93172fbc125614aa701007b37bb583853ef1601612cd0dd11bf2018743eb16e
7
+ data.tar.gz: d863237002f2fb15327c05042511746edac63c9a315cf08a90fdfca1b3c270411f221dab98f4a5d4452cfeaa0b2bf41a3f24449467c4e44ac1c8dad3bef91c57
Binary file
Binary file
@@ -61,7 +61,6 @@ module GRPC
61
61
  @call = call
62
62
  @marshal = marshal
63
63
  @op_notifier = nil # signals completion on clients
64
- @readq = Queue.new
65
64
  @unmarshal = unmarshal
66
65
  @metadata_received = metadata_received
67
66
  @reads_complete = false
@@ -81,8 +80,7 @@ module GRPC
81
80
  def run_on_client(requests, op_notifier, &blk)
82
81
  @op_notifier = op_notifier
83
82
  @enq_th = Thread.new { write_loop(requests) }
84
- @loop_th = start_read_loop
85
- each_queued_msg(&blk)
83
+ read_loop(&blk)
86
84
  end
87
85
 
88
86
  # Begins orchestration of the Bidi stream for a server generating replies.
@@ -97,8 +95,7 @@ module GRPC
97
95
  #
98
96
  # @param gen_each_reply [Proc] generates the BiDi stream replies.
99
97
  def run_on_server(gen_each_reply)
100
- replys = gen_each_reply.call(each_queued_msg)
101
- @loop_th = start_read_loop(is_client: false)
98
+ replys = gen_each_reply.call(read_loop(is_client: false))
102
99
  write_loop(replys, is_client: false)
103
100
  end
104
101
 
@@ -135,24 +132,6 @@ module GRPC
135
132
  batch_result
136
133
  end
137
134
 
138
- # each_queued_msg yields each message on this instances readq
139
- #
140
- # - messages are added to the readq by #read_loop
141
- # - iteration ends when the instance itself is added
142
- def each_queued_msg
143
- return enum_for(:each_queued_msg) unless block_given?
144
- count = 0
145
- loop do
146
- GRPC.logger.debug("each_queued_msg: waiting##{count}")
147
- count += 1
148
- req = @readq.pop
149
- GRPC.logger.debug("each_queued_msg: req = #{req}")
150
- fail req if req.is_a? StandardError
151
- break if req.equal?(END_OF_READS)
152
- yield req
153
- end
154
- end
155
-
156
135
  def write_loop(requests, is_client: true)
157
136
  GRPC.logger.debug('bidi-write-loop: starting')
158
137
  count = 0
@@ -190,47 +169,45 @@ module GRPC
190
169
  raise e
191
170
  end
192
171
 
193
- # starts the read loop
194
- def start_read_loop(is_client: true)
195
- Thread.new do
196
- GRPC.logger.debug('bidi-read-loop: starting')
197
- begin
198
- count = 0
199
- # queue the initial read before beginning the loop
200
- loop do
201
- GRPC.logger.debug("bidi-read-loop: #{count}")
202
- count += 1
203
- batch_result = read_using_run_batch
204
-
205
- # handle the next message
206
- if batch_result.message.nil?
207
- GRPC.logger.debug("bidi-read-loop: null batch #{batch_result}")
208
-
209
- if is_client
210
- batch_result = @call.run_batch(RECV_STATUS_ON_CLIENT => nil)
211
- @call.status = batch_result.status
212
- batch_result.check_status
213
- GRPC.logger.debug("bidi-read-loop: done status #{@call.status}")
214
- end
215
-
216
- @readq.push(END_OF_READS)
217
- GRPC.logger.debug('bidi-read-loop: done reading!')
218
- break
172
+ # Provides an enumerator that yields results of remote reads
173
+ def read_loop(is_client: true)
174
+ return enum_for(:read_loop,
175
+ is_client: is_client) unless block_given?
176
+ GRPC.logger.debug('bidi-read-loop: starting')
177
+ begin
178
+ count = 0
179
+ # queue the initial read before beginning the loop
180
+ loop do
181
+ GRPC.logger.debug("bidi-read-loop: #{count}")
182
+ count += 1
183
+ batch_result = read_using_run_batch
184
+
185
+ # handle the next message
186
+ if batch_result.message.nil?
187
+ GRPC.logger.debug("bidi-read-loop: null batch #{batch_result}")
188
+
189
+ if is_client
190
+ batch_result = @call.run_batch(RECV_STATUS_ON_CLIENT => nil)
191
+ @call.status = batch_result.status
192
+ batch_result.check_status
193
+ GRPC.logger.debug("bidi-read-loop: done status #{@call.status}")
219
194
  end
220
195
 
221
- # push the latest read onto the queue and continue reading
222
- res = @unmarshal.call(batch_result.message)
223
- @readq.push(res)
196
+ GRPC.logger.debug('bidi-read-loop: done reading!')
197
+ break
224
198
  end
225
- rescue StandardError => e
226
- GRPC.logger.warn('bidi: read-loop failed')
227
- GRPC.logger.warn(e)
228
- @readq.push(e) # let each_queued_msg terminate with this error
199
+
200
+ res = @unmarshal.call(batch_result.message)
201
+ yield res
229
202
  end
230
- GRPC.logger.debug('bidi-read-loop: finished')
231
- @reads_complete = true
232
- finished
203
+ rescue StandardError => e
204
+ GRPC.logger.warn('bidi: read-loop failed')
205
+ GRPC.logger.warn(e)
206
+ raise e
233
207
  end
208
+ GRPC.logger.debug('bidi-read-loop: finished')
209
+ @reads_complete = true
210
+ finished
234
211
  end
235
212
  end
236
213
  end
Binary file
@@ -29,5 +29,5 @@
29
29
 
30
30
  # GRPC contains the General RPC module.
31
31
  module GRPC
32
- VERSION = '1.0.0.pre2'
32
+ VERSION = '1.0.0'
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre2
4
+ version: 1.0.0
5
5
  platform: x86-linux
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2016-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -294,9 +294,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
294
  version: 2.0.0
295
295
  required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - ">"
297
+ - - ">="
298
298
  - !ruby/object:Gem::Version
299
- version: 1.3.1
299
+ version: '0'
300
300
  requirements: []
301
301
  rubyforge_project:
302
302
  rubygems_version: 2.5.1