grpc 0.14.1-universal-darwin → 0.15.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 +4 -4
- data/src/ruby/bin/math_services.rb +41 -2
- data/src/ruby/ext/grpc/rb_call.c +42 -40
- data/src/ruby/ext/grpc/rb_channel.c +1 -1
- data/src/ruby/ext/grpc/rb_completion_queue.c +59 -6
- data/src/ruby/ext/grpc/rb_completion_queue.h +1 -1
- data/src/ruby/ext/grpc/rb_grpc.c +1 -3
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +21 -5
- data/src/ruby/ext/grpc/rb_loader.c +1 -1
- data/src/ruby/ext/grpc/rb_server.c +5 -3
- data/src/ruby/lib/grpc.rb +0 -3
- data/src/ruby/lib/grpc/2.0/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.1/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.2/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.3/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/errors.rb +3 -2
- data/src/ruby/lib/grpc/generic/active_call.rb +32 -42
- data/src/ruby/lib/grpc/generic/bidi_call.rb +20 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +31 -54
- data/src/ruby/lib/grpc/generic/rpc_desc.rb +4 -4
- data/src/ruby/lib/grpc/generic/rpc_server.rb +12 -23
- data/src/ruby/lib/grpc/generic/service.rb +8 -8
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services.rb +30 -2
- data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb +34 -4
- data/src/ruby/pb/grpc/testing/metrics_services.rb +39 -2
- data/src/ruby/pb/src/proto/grpc/testing/empty.rb +15 -0
- data/src/ruby/pb/src/proto/grpc/testing/messages.rb +84 -0
- data/src/ruby/pb/src/proto/grpc/testing/test.rb +14 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_services.rb +110 -0
- data/src/ruby/pb/test/client.rb +5 -2
- data/src/ruby/spec/generic/active_call_spec.rb +3 -2
- data/src/ruby/spec/generic/client_stub_spec.rb +27 -24
- data/src/ruby/spec/generic/rpc_desc_spec.rb +11 -11
- data/src/ruby/spec/generic/rpc_server_spec.rb +42 -61
- data/src/ruby/spec/pb/health/checker_spec.rb +3 -5
- metadata +6 -5
- data/src/ruby/ext/grpc/rb_signal.c +0 -70
- data/src/ruby/ext/grpc/rb_signal.h +0 -39
- data/src/ruby/lib/grpc/signals.rb +0 -69
@@ -170,17 +170,15 @@ describe Grpc::Health::Checker do
|
|
170
170
|
before(:each) do
|
171
171
|
@server_queue = GRPC::Core::CompletionQueue.new
|
172
172
|
server_host = '0.0.0.0:0'
|
173
|
-
@server = GRPC::Core::Server.new(@server_queue, nil)
|
174
|
-
server_port = @server.add_http2_port(server_host, :this_port_is_insecure)
|
175
|
-
@host = "localhost:#{server_port}"
|
176
|
-
@ch = GRPC::Core::Channel.new(@host, nil, :this_channel_is_insecure)
|
177
173
|
@client_opts = { channel_override: @ch }
|
178
174
|
server_opts = {
|
179
|
-
server_override: @server,
|
180
175
|
completion_queue_override: @server_queue,
|
181
176
|
poll_period: 1
|
182
177
|
}
|
183
178
|
@srv = RpcServer.new(**server_opts)
|
179
|
+
server_port = @srv.add_http2_port(server_host, :this_port_is_insecure)
|
180
|
+
@host = "localhost:#{server_port}"
|
181
|
+
@ch = GRPC::Core::Channel.new(@host, nil, :this_channel_is_insecure)
|
184
182
|
end
|
185
183
|
|
186
184
|
after(:each) do
|
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: 0.15.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-
|
11
|
+
date: 2016-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -224,8 +224,6 @@ files:
|
|
224
224
|
- src/ruby/ext/grpc/rb_server.h
|
225
225
|
- src/ruby/ext/grpc/rb_server_credentials.c
|
226
226
|
- src/ruby/ext/grpc/rb_server_credentials.h
|
227
|
-
- src/ruby/ext/grpc/rb_signal.c
|
228
|
-
- src/ruby/ext/grpc/rb_signal.h
|
229
227
|
- src/ruby/lib/grpc.rb
|
230
228
|
- src/ruby/lib/grpc/2.0/grpc_c.bundle
|
231
229
|
- src/ruby/lib/grpc/2.1/grpc_c.bundle
|
@@ -242,7 +240,6 @@ files:
|
|
242
240
|
- src/ruby/lib/grpc/grpc.rb
|
243
241
|
- src/ruby/lib/grpc/logconfig.rb
|
244
242
|
- src/ruby/lib/grpc/notifier.rb
|
245
|
-
- src/ruby/lib/grpc/signals.rb
|
246
243
|
- src/ruby/lib/grpc/version.rb
|
247
244
|
- src/ruby/pb/README.md
|
248
245
|
- src/ruby/pb/generate_proto_ruby.sh
|
@@ -252,6 +249,10 @@ files:
|
|
252
249
|
- src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb
|
253
250
|
- src/ruby/pb/grpc/testing/metrics.rb
|
254
251
|
- src/ruby/pb/grpc/testing/metrics_services.rb
|
252
|
+
- src/ruby/pb/src/proto/grpc/testing/empty.rb
|
253
|
+
- src/ruby/pb/src/proto/grpc/testing/messages.rb
|
254
|
+
- src/ruby/pb/src/proto/grpc/testing/test.rb
|
255
|
+
- src/ruby/pb/src/proto/grpc/testing/test_services.rb
|
255
256
|
- src/ruby/pb/test/client.rb
|
256
257
|
- src/ruby/pb/test/proto/empty.rb
|
257
258
|
- src/ruby/pb/test/proto/messages.rb
|
@@ -1,70 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* Copyright 2016, Google Inc.
|
4
|
-
* All rights reserved.
|
5
|
-
*
|
6
|
-
* Redistribution and use in source and binary forms, with or without
|
7
|
-
* modification, are permitted provided that the following conditions are
|
8
|
-
* met:
|
9
|
-
*
|
10
|
-
* * Redistributions of source code must retain the above copyright
|
11
|
-
* notice, this list of conditions and the following disclaimer.
|
12
|
-
* * Redistributions in binary form must reproduce the above
|
13
|
-
* copyright notice, this list of conditions and the following disclaimer
|
14
|
-
* in the documentation and/or other materials provided with the
|
15
|
-
* distribution.
|
16
|
-
* * Neither the name of Google Inc. nor the names of its
|
17
|
-
* contributors may be used to endorse or promote products derived from
|
18
|
-
* this software without specific prior written permission.
|
19
|
-
*
|
20
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
-
*
|
32
|
-
*/
|
33
|
-
|
34
|
-
#include <ruby/ruby.h>
|
35
|
-
#include <signal.h>
|
36
|
-
#include <stdbool.h>
|
37
|
-
|
38
|
-
#include <grpc/support/log.h>
|
39
|
-
|
40
|
-
#include "rb_grpc.h"
|
41
|
-
|
42
|
-
static void (*old_sigint_handler)(int);
|
43
|
-
static void (*old_sigterm_handler)(int);
|
44
|
-
|
45
|
-
static volatile bool signal_received = false;
|
46
|
-
|
47
|
-
/* This has to be handled at the C level instead of Ruby, because Ruby signal
|
48
|
-
* handlers are constrained to run in the main interpreter thread. If that main
|
49
|
-
* thread is blocked on grpc_completion_queue_pluck, the signal handlers will
|
50
|
-
* never run */
|
51
|
-
static void handle_signal(int signum) {
|
52
|
-
signal_received = true;
|
53
|
-
if (signum == SIGINT) {
|
54
|
-
old_sigint_handler(signum);
|
55
|
-
} else if (signum == SIGTERM) {
|
56
|
-
old_sigterm_handler(signum);
|
57
|
-
}
|
58
|
-
}
|
59
|
-
|
60
|
-
static VALUE grpc_rb_signal_received(VALUE self) {
|
61
|
-
(void)self;
|
62
|
-
return signal_received ? Qtrue : Qfalse;
|
63
|
-
}
|
64
|
-
|
65
|
-
void Init_grpc_signals() {
|
66
|
-
old_sigint_handler = signal(SIGINT, handle_signal);
|
67
|
-
old_sigterm_handler = signal(SIGTERM, handle_signal);
|
68
|
-
rb_define_singleton_method(grpc_rb_mGrpcCore, "signal_received?",
|
69
|
-
grpc_rb_signal_received, 0);
|
70
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* Copyright 2016, Google Inc.
|
4
|
-
* All rights reserved.
|
5
|
-
*
|
6
|
-
* Redistribution and use in source and binary forms, with or without
|
7
|
-
* modification, are permitted provided that the following conditions are
|
8
|
-
* met:
|
9
|
-
*
|
10
|
-
* * Redistributions of source code must retain the above copyright
|
11
|
-
* notice, this list of conditions and the following disclaimer.
|
12
|
-
* * Redistributions in binary form must reproduce the above
|
13
|
-
* copyright notice, this list of conditions and the following disclaimer
|
14
|
-
* in the documentation and/or other materials provided with the
|
15
|
-
* distribution.
|
16
|
-
* * Neither the name of Google Inc. nor the names of its
|
17
|
-
* contributors may be used to endorse or promote products derived from
|
18
|
-
* this software without specific prior written permission.
|
19
|
-
*
|
20
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
-
*
|
32
|
-
*/
|
33
|
-
|
34
|
-
#ifndef GRPC_RB_SIGNAL_H_
|
35
|
-
#define GRPC_RB_SIGNAL_H_
|
36
|
-
|
37
|
-
void Init_grpc_signals();
|
38
|
-
|
39
|
-
#endif /* GRPC_RB_SIGNAL_H_ */
|
@@ -1,69 +0,0 @@
|
|
1
|
-
# Copyright 2016, 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 'thread'
|
31
|
-
require_relative 'grpc'
|
32
|
-
|
33
|
-
# GRPC contains the General RPC module.
|
34
|
-
module GRPC
|
35
|
-
# Signals contains gRPC functions related to signal handling
|
36
|
-
module Signals
|
37
|
-
@interpreter_exiting = false
|
38
|
-
@signal_handlers = []
|
39
|
-
@handlers_mutex = Mutex.new
|
40
|
-
|
41
|
-
def register_handler(&handler)
|
42
|
-
@handlers_mutex.synchronize do
|
43
|
-
@signal_handlers.push(handler)
|
44
|
-
handler.call if @exit_signal_received
|
45
|
-
end
|
46
|
-
# Returns a function to remove the handler
|
47
|
-
lambda do
|
48
|
-
@handlers_mutex.synchronize { @signal_handlers.delete(handler) }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
module_function :register_handler
|
52
|
-
|
53
|
-
def wait_for_signals
|
54
|
-
t = Thread.new do
|
55
|
-
sleep 0.1 until GRPC::Core.signal_received? || @interpreter_exiting
|
56
|
-
unless @interpreter_exiting
|
57
|
-
@handlers_mutex.synchronize do
|
58
|
-
@signal_handlers.each(&:call)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
at_exit do
|
63
|
-
@interpreter_exiting = true
|
64
|
-
t.join
|
65
|
-
end
|
66
|
-
end
|
67
|
-
module_function :wait_for_signals
|
68
|
-
end
|
69
|
-
end
|