grpc 0.15.0-x86-mingw32 → 1.0.0.pre1-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 +4 -4
- data/etc/roots.pem +784 -509
- data/grpc_c.32.ruby +0 -0
- data/grpc_c.64.ruby +0 -0
- data/src/ruby/ext/grpc/rb_byte_buffer.c +4 -1
- data/src/ruby/ext/grpc/rb_call.c +87 -54
- data/src/ruby/ext/grpc/rb_call.h +1 -1
- data/src/ruby/ext/grpc/rb_call_credentials.c +1 -30
- data/src/ruby/ext/grpc/rb_channel.c +25 -50
- data/src/ruby/ext/grpc/rb_channel_credentials.c +1 -31
- data/src/ruby/ext/grpc/rb_completion_queue.c +15 -134
- data/src/ruby/ext/grpc/rb_completion_queue.h +3 -7
- data/src/ruby/ext/grpc/rb_grpc.c +2 -4
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +4 -1
- data/src/ruby/ext/grpc/rb_server.c +81 -133
- data/src/ruby/ext/grpc/rb_server_credentials.c +4 -33
- data/src/ruby/lib/grpc/2.0/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.1/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.2/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.3/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/generic/active_call.rb +40 -55
- data/src/ruby/lib/grpc/generic/bidi_call.rb +21 -23
- data/src/ruby/lib/grpc/generic/client_stub.rb +20 -15
- data/src/ruby/lib/grpc/generic/rpc_server.rb +15 -37
- data/src/ruby/lib/grpc/generic/service.rb +1 -1
- data/src/ruby/lib/grpc/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/test/client.rb +25 -7
- data/src/ruby/pb/test/server.rb +7 -5
- data/src/ruby/spec/call_spec.rb +1 -2
- data/src/ruby/spec/channel_spec.rb +2 -3
- data/src/ruby/spec/client_server_spec.rb +74 -59
- data/src/ruby/spec/generic/active_call_spec.rb +66 -86
- data/src/ruby/spec/generic/client_stub_spec.rb +27 -48
- data/src/ruby/spec/generic/rpc_server_spec.rb +4 -34
- data/src/ruby/spec/pb/health/checker_spec.rb +0 -2
- data/src/ruby/spec/server_spec.rb +20 -24
- metadata +4 -6
- data/src/ruby/spec/completion_queue_spec.rb +0 -42
@@ -95,7 +95,7 @@ class FailingService
|
|
95
95
|
def initialize(_default_var = 'ignored')
|
96
96
|
@details = 'app error'
|
97
97
|
@code = 101
|
98
|
-
@md = { failed_method
|
98
|
+
@md = { 'failed_method' => 'an_rpc' }
|
99
99
|
end
|
100
100
|
|
101
101
|
def an_rpc(_req, _call)
|
@@ -135,8 +135,6 @@ describe GRPC::RpcServer do
|
|
135
135
|
@pass = 0
|
136
136
|
@fail = 1
|
137
137
|
@noop = proc { |x| x }
|
138
|
-
|
139
|
-
@server_queue = GRPC::Core::CompletionQueue.new
|
140
138
|
end
|
141
139
|
|
142
140
|
describe '#new' do
|
@@ -148,28 +146,6 @@ describe GRPC::RpcServer do
|
|
148
146
|
expect(&blk).not_to raise_error
|
149
147
|
end
|
150
148
|
|
151
|
-
it 'can be created with a completion queue override' do
|
152
|
-
opts = {
|
153
|
-
server_args: { a_channel_arg: 'an_arg' },
|
154
|
-
completion_queue_override: @server_queue
|
155
|
-
}
|
156
|
-
blk = proc do
|
157
|
-
RpcServer.new(**opts)
|
158
|
-
end
|
159
|
-
expect(&blk).not_to raise_error
|
160
|
-
end
|
161
|
-
|
162
|
-
it 'cannot be created with a bad completion queue override' do
|
163
|
-
blk = proc do
|
164
|
-
opts = {
|
165
|
-
server_args: { a_channel_arg: 'an_arg' },
|
166
|
-
completion_queue_override: Object.new
|
167
|
-
}
|
168
|
-
RpcServer.new(**opts)
|
169
|
-
end
|
170
|
-
expect(&blk).to raise_error
|
171
|
-
end
|
172
|
-
|
173
149
|
it 'cannot be created with invalid ServerCredentials' do
|
174
150
|
blk = proc do
|
175
151
|
opts = {
|
@@ -294,7 +270,6 @@ describe GRPC::RpcServer do
|
|
294
270
|
context 'with no connect_metadata' do
|
295
271
|
before(:each) do
|
296
272
|
server_opts = {
|
297
|
-
completion_queue_override: @server_queue,
|
298
273
|
poll_period: 1
|
299
274
|
}
|
300
275
|
@srv = RpcServer.new(**server_opts)
|
@@ -309,8 +284,7 @@ describe GRPC::RpcServer do
|
|
309
284
|
@srv.wait_till_running
|
310
285
|
req = EchoMsg.new
|
311
286
|
blk = proc do
|
312
|
-
|
313
|
-
stub = GRPC::ClientStub.new(@host, cq, :this_channel_is_insecure,
|
287
|
+
stub = GRPC::ClientStub.new(@host, :this_channel_is_insecure,
|
314
288
|
**client_opts)
|
315
289
|
stub.request_response('/unknown', req, marshal, unmarshal)
|
316
290
|
end
|
@@ -325,8 +299,7 @@ describe GRPC::RpcServer do
|
|
325
299
|
@srv.wait_till_running
|
326
300
|
req = EchoMsg.new
|
327
301
|
blk = proc do
|
328
|
-
|
329
|
-
stub = GRPC::ClientStub.new(@host, cq, :this_channel_is_insecure,
|
302
|
+
stub = GRPC::ClientStub.new(@host, :this_channel_is_insecure,
|
330
303
|
**client_opts)
|
331
304
|
stub.request_response('/an_rpc', req, marshal, unmarshal)
|
332
305
|
end
|
@@ -422,7 +395,6 @@ describe GRPC::RpcServer do
|
|
422
395
|
it 'should return RESOURCE_EXHAUSTED on too many jobs', server: true do
|
423
396
|
opts = {
|
424
397
|
server_args: { a_channel_arg: 'an_arg' },
|
425
|
-
completion_queue_override: @server_queue,
|
426
398
|
pool_size: 1,
|
427
399
|
poll_period: 1,
|
428
400
|
max_waiting_requests: 0
|
@@ -466,7 +438,6 @@ describe GRPC::RpcServer do
|
|
466
438
|
end
|
467
439
|
before(:each) do
|
468
440
|
server_opts = {
|
469
|
-
completion_queue_override: @server_queue,
|
470
441
|
poll_period: 1,
|
471
442
|
connect_md_proc: test_md_proc
|
472
443
|
}
|
@@ -502,7 +473,6 @@ describe GRPC::RpcServer do
|
|
502
473
|
context 'with trailing metadata' do
|
503
474
|
before(:each) do
|
504
475
|
server_opts = {
|
505
|
-
completion_queue_override: @server_queue,
|
506
476
|
poll_period: 1
|
507
477
|
}
|
508
478
|
@srv = RpcServer.new(**server_opts)
|
@@ -545,7 +515,7 @@ describe GRPC::RpcServer do
|
|
545
515
|
op = stub.an_rpc(req, return_op: true, metadata: { k1: 'v1', k2: 'v2' })
|
546
516
|
expect(op.metadata).to be nil
|
547
517
|
expect(op.execute).to be_a(EchoMsg)
|
548
|
-
expect(op.
|
518
|
+
expect(op.trailing_metadata).to eq(wanted_trailers)
|
549
519
|
@srv.stop
|
550
520
|
t.join
|
551
521
|
end
|
@@ -168,11 +168,9 @@ describe Grpc::Health::Checker do
|
|
168
168
|
CheckerStub = Grpc::Health::Checker.rpc_stub_class
|
169
169
|
|
170
170
|
before(:each) do
|
171
|
-
@server_queue = GRPC::Core::CompletionQueue.new
|
172
171
|
server_host = '0.0.0.0:0'
|
173
172
|
@client_opts = { channel_override: @ch }
|
174
173
|
server_opts = {
|
175
|
-
completion_queue_override: @server_queue,
|
176
174
|
poll_period: 1
|
177
175
|
}
|
178
176
|
@srv = RpcServer.new(**server_opts)
|
@@ -43,19 +43,15 @@ describe Server do
|
|
43
43
|
GRPC::Core::ServerCredentials.new(*load_test_certs)
|
44
44
|
end
|
45
45
|
|
46
|
-
before(:each) do
|
47
|
-
@cq = GRPC::Core::CompletionQueue.new
|
48
|
-
end
|
49
|
-
|
50
46
|
describe '#start' do
|
51
47
|
it 'runs without failing' do
|
52
|
-
blk = proc { Server.new(
|
48
|
+
blk = proc { Server.new(nil).start }
|
53
49
|
expect(&blk).to_not raise_error
|
54
50
|
end
|
55
51
|
|
56
52
|
it 'fails if the server is closed' do
|
57
|
-
s = Server.new(
|
58
|
-
s.close
|
53
|
+
s = Server.new(nil)
|
54
|
+
s.close
|
59
55
|
expect { s.start }.to raise_error(RuntimeError)
|
60
56
|
end
|
61
57
|
end
|
@@ -63,19 +59,19 @@ describe Server do
|
|
63
59
|
describe '#destroy' do
|
64
60
|
it 'destroys a server ok' do
|
65
61
|
s = start_a_server
|
66
|
-
blk = proc { s.destroy
|
62
|
+
blk = proc { s.destroy }
|
67
63
|
expect(&blk).to_not raise_error
|
68
64
|
end
|
69
65
|
|
70
66
|
it 'can be called more than once without error' do
|
71
67
|
s = start_a_server
|
72
68
|
begin
|
73
|
-
blk = proc { s.destroy
|
69
|
+
blk = proc { s.destroy }
|
74
70
|
expect(&blk).to_not raise_error
|
75
71
|
blk.call
|
76
72
|
expect(&blk).to_not raise_error
|
77
73
|
ensure
|
78
|
-
s.close
|
74
|
+
s.close
|
79
75
|
end
|
80
76
|
end
|
81
77
|
end
|
@@ -84,7 +80,7 @@ describe Server do
|
|
84
80
|
it 'closes a server ok' do
|
85
81
|
s = start_a_server
|
86
82
|
begin
|
87
|
-
blk = proc { s.close
|
83
|
+
blk = proc { s.close }
|
88
84
|
expect(&blk).to_not raise_error
|
89
85
|
ensure
|
90
86
|
s.close(@cq)
|
@@ -93,7 +89,7 @@ describe Server do
|
|
93
89
|
|
94
90
|
it 'can be called more than once without error' do
|
95
91
|
s = start_a_server
|
96
|
-
blk = proc { s.close
|
92
|
+
blk = proc { s.close }
|
97
93
|
expect(&blk).to_not raise_error
|
98
94
|
blk.call
|
99
95
|
expect(&blk).to_not raise_error
|
@@ -104,16 +100,16 @@ describe Server do
|
|
104
100
|
describe 'for insecure servers' do
|
105
101
|
it 'runs without failing' do
|
106
102
|
blk = proc do
|
107
|
-
s = Server.new(
|
103
|
+
s = Server.new(nil)
|
108
104
|
s.add_http2_port('localhost:0', :this_port_is_insecure)
|
109
|
-
s.close
|
105
|
+
s.close
|
110
106
|
end
|
111
107
|
expect(&blk).to_not raise_error
|
112
108
|
end
|
113
109
|
|
114
110
|
it 'fails if the server is closed' do
|
115
|
-
s = Server.new(
|
116
|
-
s.close
|
111
|
+
s = Server.new(nil)
|
112
|
+
s.close
|
117
113
|
blk = proc do
|
118
114
|
s.add_http2_port('localhost:0', :this_port_is_insecure)
|
119
115
|
end
|
@@ -125,16 +121,16 @@ describe Server do
|
|
125
121
|
let(:cert) { create_test_cert }
|
126
122
|
it 'runs without failing' do
|
127
123
|
blk = proc do
|
128
|
-
s = Server.new(
|
124
|
+
s = Server.new(nil)
|
129
125
|
s.add_http2_port('localhost:0', cert)
|
130
|
-
s.close
|
126
|
+
s.close
|
131
127
|
end
|
132
128
|
expect(&blk).to_not raise_error
|
133
129
|
end
|
134
130
|
|
135
131
|
it 'fails if the server is closed' do
|
136
|
-
s = Server.new(
|
137
|
-
s.close
|
132
|
+
s = Server.new(nil)
|
133
|
+
s.close
|
138
134
|
blk = proc { s.add_http2_port('localhost:0', cert) }
|
139
135
|
expect(&blk).to raise_error(RuntimeError)
|
140
136
|
end
|
@@ -142,8 +138,8 @@ describe Server do
|
|
142
138
|
end
|
143
139
|
|
144
140
|
shared_examples '#new' do
|
145
|
-
it 'takes
|
146
|
-
expect { Server.new(
|
141
|
+
it 'takes nil channel args' do
|
142
|
+
expect { Server.new(nil) }.to_not raise_error
|
147
143
|
end
|
148
144
|
|
149
145
|
it 'does not take a hash with bad keys as channel args' do
|
@@ -194,14 +190,14 @@ describe Server do
|
|
194
190
|
|
195
191
|
describe '#new with an insecure channel' do
|
196
192
|
def construct_with_args(a)
|
197
|
-
proc { Server.new(
|
193
|
+
proc { Server.new(a) }
|
198
194
|
end
|
199
195
|
|
200
196
|
it_behaves_like '#new'
|
201
197
|
end
|
202
198
|
|
203
199
|
def start_a_server
|
204
|
-
s = Server.new(
|
200
|
+
s = Server.new(nil)
|
205
201
|
s.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
|
206
202
|
s.start
|
207
203
|
s
|
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: 0.
|
4
|
+
version: 1.0.0.pre1
|
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-
|
11
|
+
date: 2016-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -265,7 +265,6 @@ files:
|
|
265
265
|
- src/ruby/spec/channel_credentials_spec.rb
|
266
266
|
- src/ruby/spec/channel_spec.rb
|
267
267
|
- src/ruby/spec/client_server_spec.rb
|
268
|
-
- src/ruby/spec/completion_queue_spec.rb
|
269
268
|
- src/ruby/spec/generic/active_call_spec.rb
|
270
269
|
- src/ruby/spec/generic/client_stub_spec.rb
|
271
270
|
- src/ruby/spec/generic/rpc_desc_spec.rb
|
@@ -299,9 +298,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
298
|
version: 2.0.0
|
300
299
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
301
300
|
requirements:
|
302
|
-
- - "
|
301
|
+
- - ">"
|
303
302
|
- !ruby/object:Gem::Version
|
304
|
-
version:
|
303
|
+
version: 1.3.1
|
305
304
|
requirements: []
|
306
305
|
rubyforge_project:
|
307
306
|
rubygems_version: 2.5.1
|
@@ -329,5 +328,4 @@ test_files:
|
|
329
328
|
- src/ruby/spec/time_consts_spec.rb
|
330
329
|
- src/ruby/spec/channel_credentials_spec.rb
|
331
330
|
- src/ruby/spec/call_credentials_spec.rb
|
332
|
-
- src/ruby/spec/completion_queue_spec.rb
|
333
331
|
- src/ruby/spec/server_spec.rb
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# Copyright 2015, Google Inc.
|
2
|
-
# All rights reserved.
|
3
|
-
#
|
4
|
-
# Redistribution and use in source and binary forms, with or without
|
5
|
-
# modification, are permitted provided that the following conditions are
|
6
|
-
# met:
|
7
|
-
#
|
8
|
-
# * Redistributions of source code must retain the above copyright
|
9
|
-
# notice, this list of conditions and the following disclaimer.
|
10
|
-
# * Redistributions in binary form must reproduce the above
|
11
|
-
# copyright notice, this list of conditions and the following disclaimer
|
12
|
-
# in the documentation and/or other materials provided with the
|
13
|
-
# distribution.
|
14
|
-
# * Neither the name of Google Inc. nor the names of its
|
15
|
-
# contributors may be used to endorse or promote products derived from
|
16
|
-
# this software without specific prior written permission.
|
17
|
-
#
|
18
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
-
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
-
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
-
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
|
30
|
-
require 'grpc'
|
31
|
-
|
32
|
-
describe GRPC::Core::CompletionQueue do
|
33
|
-
before(:example) do
|
34
|
-
@cq = GRPC::Core::CompletionQueue.new
|
35
|
-
end
|
36
|
-
|
37
|
-
describe '#new' do
|
38
|
-
it 'is constructed successufully' do
|
39
|
-
expect { GRPC::Core::CompletionQueue.new }.not_to raise_error
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|