gruf 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/gruf/client.rb +6 -4
- data/lib/gruf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56cf6dec601362d024f7af23944ab121a4f2aff1
|
4
|
+
data.tar.gz: 7e765e811c3c98b53faf823b168bbeca03f34cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b2bcfb022a963fbf10cb645e92a40691dc0cb4586b4579a4362a452123312a3341c8e72dd79f37f5d3615390acb1db718fc0cb5cf4d69ce0a6b479edd327584
|
7
|
+
data.tar.gz: 534ef51f35af8c749c12455f8c50e63b9967c9f9b9cf9b012795913b51b2080a068cae7acb85235d6ce9ffaddf37172a82473cc559cf864b17b876ca96682d58
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# gruf - gRPC Ruby Framework
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.
|
3
|
+
[![Build Status](https://travis-ci.org/bigcommerce/gruf.svg?branch=master)](https://travis-ci.org/bigcommerce/gruf) [![Gem Version](https://badge.fury.io/rb/gruf.svg)](https://badge.fury.io/rb/gruf) [![Documentation](https://inch-ci.org/github/bigcommerce/gruf.svg?branch=master)](https://inch-ci.org/github/bigcommerce/gruf?branch=master)
|
4
4
|
|
5
5
|
gruf is a Ruby framework that wraps the [gRPC Ruby library](https://github.com/grpc/grpc/tree/master/src/ruby) to
|
6
6
|
provide a more streamlined integration into Ruby and Ruby on Rails applications.
|
data/lib/gruf/client.rb
CHANGED
@@ -47,14 +47,14 @@ module Gruf
|
|
47
47
|
##
|
48
48
|
# Call the client's method with given params
|
49
49
|
#
|
50
|
-
def call(request_method, params = {}, metadata = {})
|
50
|
+
def call(request_method, params = {}, metadata = {}, opts = {})
|
51
51
|
req = request_object(request_method, params)
|
52
52
|
md = build_metadata(metadata)
|
53
53
|
call_sig = call_signature(request_method)
|
54
54
|
|
55
55
|
raise NotImplementedError, "The method #{request_method} has not been implemented in this service." unless call_sig
|
56
56
|
|
57
|
-
execute(call_sig, req, md)
|
57
|
+
execute(call_sig, req, md, opts)
|
58
58
|
rescue GRPC::BadStatus => e
|
59
59
|
emk = Gruf.error_metadata_key.to_s
|
60
60
|
raise Gruf::Client::Error, error_deserializer_class.new(e.metadata[emk]).deserialize if e.respond_to?(:metadata) && e.metadata.key?(emk)
|
@@ -68,9 +68,11 @@ module Gruf
|
|
68
68
|
# @param [Object] req
|
69
69
|
# @param [Hash] md
|
70
70
|
#
|
71
|
-
def execute(call_sig, req, md)
|
71
|
+
def execute(call_sig, req, md, opts)
|
72
72
|
timed = Timer.time do
|
73
|
-
|
73
|
+
opts[:return_op] = true
|
74
|
+
opts[:metadata] = md
|
75
|
+
send(call_sig, req, opts)
|
74
76
|
end
|
75
77
|
Gruf::Response.new(timed.result, timed.time)
|
76
78
|
end
|
data/lib/gruf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gruf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaun McCormick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|