protocol-grpc 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/context/getting-started.md +4 -3
- data/design.md +0 -12
- data/lib/protocol/grpc/call.rb +6 -10
- data/lib/protocol/grpc/version.rb +1 -1
- data/readme.md +5 -0
- data/releases.md +5 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c7aa96e69acd0574147e4c3e8c16fba62e8278d01e094267d3cb3427221d8fa0
|
|
4
|
+
data.tar.gz: 303976d191a6b5ff5e20db644ef2f29a71c5b7c346558eac2a3e5122c1197bff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bc1343e7e2e8e21206139992f9483a1c970b21456f90bfb124d4fdd8728eedb51b921a7d93999ece219fd4b079cb9c9e0b2433750e6ee249c234124a1dfaba3
|
|
7
|
+
data.tar.gz: cea3a080a0cea063968a40939451b2c2f044f1e4b9068b64f231272e7f2c2d953f6f7ceabef437762700cf2d36b04a90ffb94dfd43ef76f2e5b4ed55d6e4ba29
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/context/getting-started.md
CHANGED
|
@@ -18,7 +18,7 @@ $ bundle add protocol-grpc
|
|
|
18
18
|
- A {ruby Protocol::GRPC::Body::Readable} class which handles reading gRPC messages from HTTP request/response bodies with automatic framing and decoding.
|
|
19
19
|
- A {ruby Protocol::GRPC::Body::Writable} class which handles writing gRPC messages to HTTP request/response bodies with automatic framing and encoding.
|
|
20
20
|
- A {ruby Protocol::GRPC::Middleware} abstract base class for building gRPC server applications.
|
|
21
|
-
- A {ruby Protocol::GRPC::Call} class which represents the
|
|
21
|
+
- A {ruby Protocol::GRPC::Call} class which represents the request, response, metadata, and deadline for a single gRPC RPC call.
|
|
22
22
|
- A {ruby Protocol::GRPC::Status} module with gRPC status code constants.
|
|
23
23
|
- A {ruby Protocol::GRPC::Error} hierarchy for gRPC-specific error handling.
|
|
24
24
|
|
|
@@ -132,13 +132,14 @@ end
|
|
|
132
132
|
``` ruby
|
|
133
133
|
require "protocol/grpc/call"
|
|
134
134
|
|
|
135
|
-
call = Protocol::GRPC::Call.new(request, deadline: deadline)
|
|
135
|
+
call = Protocol::GRPC::Call.new(request, response, deadline: deadline)
|
|
136
136
|
|
|
137
137
|
# Access request
|
|
138
138
|
call.request # => Protocol::HTTP::Request
|
|
139
139
|
|
|
140
|
-
# Check deadline
|
|
140
|
+
# Check deadline and status
|
|
141
141
|
call.deadline.exceeded? # => false
|
|
142
|
+
call.status # => Protocol::GRPC::Status::OK
|
|
142
143
|
|
|
143
144
|
# Access peer information
|
|
144
145
|
call.peer # => Protocol::HTTP::Address
|
data/design.md
CHANGED
|
@@ -535,7 +535,6 @@ module Protocol
|
|
|
535
535
|
def initialize(request, deadline: nil)
|
|
536
536
|
@request = request
|
|
537
537
|
@deadline = deadline
|
|
538
|
-
@cancelled = false
|
|
539
538
|
end
|
|
540
539
|
|
|
541
540
|
# @attribute [Protocol::HTTP::Request] The underlying HTTP request
|
|
@@ -562,17 +561,6 @@ module Protocol
|
|
|
562
561
|
@deadline ? [@deadline - Time.now, 0].max : nil
|
|
563
562
|
end
|
|
564
563
|
|
|
565
|
-
# Mark this call as cancelled
|
|
566
|
-
def cancel!
|
|
567
|
-
@cancelled = true
|
|
568
|
-
end
|
|
569
|
-
|
|
570
|
-
# Check if call was cancelled
|
|
571
|
-
# @returns [Boolean]
|
|
572
|
-
def cancelled?
|
|
573
|
-
@cancelled
|
|
574
|
-
end
|
|
575
|
-
|
|
576
564
|
# Get peer information (client address)
|
|
577
565
|
# @returns [String | Nil]
|
|
578
566
|
def peer
|
data/lib/protocol/grpc/call.rb
CHANGED
|
@@ -31,7 +31,6 @@ module Protocol
|
|
|
31
31
|
@request = request
|
|
32
32
|
@response = response
|
|
33
33
|
@deadline = deadline
|
|
34
|
-
@cancelled = false
|
|
35
34
|
end
|
|
36
35
|
|
|
37
36
|
# @attribute [Protocol::HTTP::Request] The underlying HTTP request.
|
|
@@ -67,15 +66,12 @@ module Protocol
|
|
|
67
66
|
@deadline&.remaining
|
|
68
67
|
end
|
|
69
68
|
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
# @returns [Boolean] `true` if the call was cancelled, `false` otherwise
|
|
77
|
-
def cancelled?
|
|
78
|
-
@cancelled
|
|
69
|
+
# Get the current gRPC status of the call.
|
|
70
|
+
# @returns [Integer | Nil] The current gRPC status code, if available.
|
|
71
|
+
def status
|
|
72
|
+
if headers = @response&.headers
|
|
73
|
+
headers["grpc-status"]&.to_i
|
|
74
|
+
end
|
|
79
75
|
end
|
|
80
76
|
|
|
81
77
|
# Get peer information (client address).
|
data/readme.md
CHANGED
|
@@ -28,6 +28,11 @@ Please see the [project documentation](https://socketry.github.io/protocol-grpc/
|
|
|
28
28
|
|
|
29
29
|
Please see the [project releases](https://socketry.github.io/protocol-grpc/releases/index) for all releases.
|
|
30
30
|
|
|
31
|
+
### v0.14.0
|
|
32
|
+
|
|
33
|
+
- **Breaking**: Removed the unused `Protocol::GRPC::Call#cancel!` and `Protocol::GRPC::Call#cancelled?` methods.
|
|
34
|
+
- Added `Protocol::GRPC::Call#status` to report the status assigned to the response.
|
|
35
|
+
|
|
31
36
|
### v0.13.1
|
|
32
37
|
|
|
33
38
|
- **Breaking**: Removed the deprecated `Protocol::GRPC::Methods` module. Use `Protocol::GRPC::Route`, `Protocol::GRPC::Metadata`, and `Protocol::GRPC::Header::Timeout` instead.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.14.0
|
|
4
|
+
|
|
5
|
+
- **Breaking**: Removed the unused `Protocol::GRPC::Call#cancel!` and `Protocol::GRPC::Call#cancelled?` methods.
|
|
6
|
+
- Added `Protocol::GRPC::Call#status` to report the status assigned to the response.
|
|
7
|
+
|
|
3
8
|
## v0.13.1
|
|
4
9
|
|
|
5
10
|
- **Breaking**: Removed the deprecated `Protocol::GRPC::Methods` module. Use `Protocol::GRPC::Route`, `Protocol::GRPC::Metadata`, and `Protocol::GRPC::Header::Timeout` instead.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|