grpc 1.0.0.pre2-x86-mingw32 → 1.0.0-x86-mingw32

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: aed6dce0f36513c2e5a826f3afb9357f3539f9fd
4
- data.tar.gz: ef5b0cffbcd61166912ddd70a361f45c2f924998
3
+ metadata.gz: d30644d10c6303aadcc3f41b0f1043974ce6dc17
4
+ data.tar.gz: d1cbc38c59e46b1df714fb0d8146bd97091425fc
5
5
  SHA512:
6
- metadata.gz: 4beb316f11255e2abef2742be6ff0021b84a21d4c0ad123db0d1cbf0f85ed6e35ae9001fa118b7150c8bd59a2658e8490c339c3657307e9a6572dde3154399f4
7
- data.tar.gz: fb0721bb17b9e7a0db595d664451ecad7aad67c2e3597a72470558ac998d8c944826e354c52f5c0b782e2caf77e2aa208d0a2d5357d330c3cac337af21d49819
6
+ metadata.gz: 26d336f9d9913721041956dd173000f01bf1932ac6a569db3eb748042d69431133133288f83d2e867ec99387414047f5b9e6664551958f278b8f19b2c649b3f4
7
+ data.tar.gz: 3c242ead91c7e5ed38ade7a751ea0f066d916416580f7775a83c05d42661a3f4f851e3fee50270be88dd83ec6bf3b965d1b447b3f63282e5a51edb8fded05b1d
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-mingw32
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