grpc 1.0.0.pre2-universal-darwin → 1.0.0-universal-darwin

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: 2b1942b65efa4eac64b9b0596189123c786d173d
4
- data.tar.gz: fdcbb6d617f1dda57b7108c7f02085c664330cbf
3
+ metadata.gz: e07c99819c80986c23436ed3d3d519228a61b76a
4
+ data.tar.gz: 185464167b1e96aa41c8ffadeca2d01c249f5723
5
5
  SHA512:
6
- metadata.gz: b8c2201934f65b8c412f8049b981bc0ab1294ef7c5267ecfdb8f6f9a4bd6ec0fbef978596f7cc925c5221d7f42a6ad25b44109416f38cbc68f8363c504f50f5e
7
- data.tar.gz: 546cf4b2983470a194191b946bea1a419b485f5aee1077b56944a80b7fdb52c1f9c2e2785e7c7c1e53c08bcf5365895a0ed23f519ce6d1d4a868042b2741ff08
6
+ metadata.gz: 8ca4b371c657c4816691a8cbae227fa61bc5dc95a1b79d9d6643b369e1d64906a6a6511b2e714b4474c4ba28b0bb9cca706d0439e30d24909363e431e7330b89
7
+ data.tar.gz: 1cccc9b1911dd4ab294d40c1aa31996d8ad0f876f265c313dd59f747816e8aba68a420fb0493534f8c51d03d366fc061d09668495472f12906f179f8dd8de69d
@@ -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
@@ -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: universal-darwin
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
@@ -293,9 +293,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
293
293
  version: 2.0.0
294
294
  required_rubygems_version: !ruby/object:Gem::Requirement
295
295
  requirements:
296
- - - ">"
296
+ - - ">="
297
297
  - !ruby/object:Gem::Version
298
- version: 1.3.1
298
+ version: '0'
299
299
  requirements: []
300
300
  rubyforge_project:
301
301
  rubygems_version: 2.4.3