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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8db09af385df9c2a441b0bf6ece236e8d3a0735a
4
- data.tar.gz: dff8c04b4439335743edb8c6cbd7e74d7cb64f43
3
+ metadata.gz: 56cf6dec601362d024f7af23944ab121a4f2aff1
4
+ data.tar.gz: 7e765e811c3c98b53faf823b168bbeca03f34cfc
5
5
  SHA512:
6
- metadata.gz: 040cfcf2678a142635796b35706dc1599e4b0364a4cc6a90fbc9628e02d3b273427452b3325d6e08988b53e80d2a08482879072c90927de16f697ad7f7937c3f
7
- data.tar.gz: 3a67f98f29b8be1b9216a0c609e040308721afe822719d591cd74a82cb3d3c791b796d96eee750e096b2de7c837607377e01101b760d1fd4fb82dcc2e98ca904
6
+ metadata.gz: 3b2bcfb022a963fbf10cb645e92a40691dc0cb4586b4579a4362a452123312a3341c8e72dd79f37f5d3615390acb1db718fc0cb5cf4d69ce0a6b479edd327584
7
+ data.tar.gz: 534ef51f35af8c749c12455f8c50e63b9967c9f9b9cf9b012795913b51b2080a068cae7acb85235d6ce9ffaddf37172a82473cc559cf864b17b876ca96682d58
@@ -1,5 +1,9 @@
1
1
  Changelog for the gruf gem. This includes internal history before the gem was made.
2
2
 
3
+ h3. 1.1.0
4
+
5
+ - Add the ability for call options to the client, which enables deadline setting
6
+
3
7
  h3. 1.0.0
4
8
 
5
9
  - Bump gRPC to 1.4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # gruf - gRPC Ruby Framework
2
2
 
3
- [![Build Status](https://travis-ci.com/bigcommerce/gruf.svg?token=D3Cc4LCF9BgpUx4dpPpv&branch=master)](https://travis-ci.com/bigcommerce/gruf)
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.
@@ -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
- send(call_sig, req, return_op: true, metadata: md)
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
@@ -15,5 +15,5 @@
15
15
  # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
16
  #
17
17
  module Gruf
18
- VERSION = '1.0.0'.freeze
18
+ VERSION = '1.1.0'.freeze
19
19
  end
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.0.0
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-06-27 00:00:00.000000000 Z
11
+ date: 2017-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler