async-grpc 0.4.0 → 0.5.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/lib/async/grpc/dispatcher.rb +13 -6
- data/lib/async/grpc/version.rb +2 -2
- data/readme.md +4 -0
- data/releases.md +4 -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: 0d86e69280d50aad838ac63b91dccd9a89d9bcdccafa13f24f053320cadd72be
|
|
4
|
+
data.tar.gz: ef7a1542c2336bd1e5b8557b4edbedb522d2451d94c3eae887ee2be79d13c500
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f06eaf7f8fa92f2e042ade8a7bc9737ea13770060c7a9f4a145aa849bc679716a83780d215bea5ce6b9e1f1a785a92651f2b64f64adeb8658ca3baf3d37c7c1e
|
|
7
|
+
data.tar.gz: 0c8e0a8a9a26a0c21e7bc2a8a2311377a1ebc105e0d5f2dd0155faf7c735672a4df3a3467154b38b37220528bb3f9834fb5307dbdbe0abb0bbd054ed5a3a8c4b
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -56,24 +56,31 @@ module Async
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
# Mark trailers and add status (if not already set by handler):
|
|
59
|
-
if call.response&.headers
|
|
60
|
-
call.response.headers.trailer!
|
|
61
|
-
|
|
59
|
+
if headers = call.response&.headers
|
|
62
60
|
# Only add OK status if grpc-status hasn't been set by the handler:
|
|
63
|
-
unless
|
|
64
|
-
Protocol::GRPC::Metadata.add_status!(
|
|
61
|
+
unless headers["grpc-status"]
|
|
62
|
+
Protocol::GRPC::Metadata.add_status!(headers, status: Protocol::GRPC::Status::OK)
|
|
65
63
|
end
|
|
66
64
|
end
|
|
67
65
|
end
|
|
68
66
|
|
|
69
67
|
def dispatch_to_service(service, handler_method, input, output, call, deadline, parent: Async::Task.current)
|
|
70
68
|
if deadline
|
|
71
|
-
parent.with_timeout(deadline) do
|
|
69
|
+
parent.with_timeout(deadline.remaining) do
|
|
72
70
|
invoke_service(service, handler_method, input, output, call)
|
|
73
71
|
end
|
|
74
72
|
else
|
|
75
73
|
invoke_service(service, handler_method, input, output, call)
|
|
76
74
|
end
|
|
75
|
+
rescue Async::TimeoutError
|
|
76
|
+
# Close input and output streams:
|
|
77
|
+
input.close
|
|
78
|
+
output.close_write unless output.closed?
|
|
79
|
+
|
|
80
|
+
# Set DEADLINE_EXCEEDED status in trailers:
|
|
81
|
+
if headers = call.response&.headers
|
|
82
|
+
Protocol::GRPC::Metadata.add_status!(headers, status: Protocol::GRPC::Status::DEADLINE_EXCEEDED, message: "Deadline exceeded")
|
|
83
|
+
end
|
|
77
84
|
end
|
|
78
85
|
|
|
79
86
|
# Dispatch the request to the appropriate service.
|
data/lib/async/grpc/version.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2025, by Samuel Williams.
|
|
4
|
+
# Copyright, 2025-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
# @namespace
|
|
7
7
|
module Async
|
|
8
8
|
# @namespace
|
|
9
9
|
module GRPC
|
|
10
|
-
VERSION = "0.
|
|
10
|
+
VERSION = "0.5.0"
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
data/readme.md
CHANGED
|
@@ -24,6 +24,10 @@ Please see the [project documentation](https://socketry.github.io/async-grpc/) f
|
|
|
24
24
|
|
|
25
25
|
Please see the [project releases](https://socketry.github.io/async-grpc/releases/index) for all releases.
|
|
26
26
|
|
|
27
|
+
### v0.5.0
|
|
28
|
+
|
|
29
|
+
- Fix handling of timeouts/deadlines.
|
|
30
|
+
|
|
27
31
|
### v0.4.0
|
|
28
32
|
|
|
29
33
|
- Fix handling of trailers.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|