ruvoy 0.2.0-aarch64-linux → 0.2.1-aarch64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 570d5fa414a87e4f204964ad1dac4b45527948bb3fed5473559cc8698cb80689
4
- data.tar.gz: 2d49878f9c9add538a8560d93988cc9c1fcbc838839f79f12e4a2f064823c739
3
+ metadata.gz: a585700c8fa8895e0202a89938ba64268f56cd01936857684f276b3904ec408a
4
+ data.tar.gz: aac2b3e316c6ed0ef47c0c205ce232cc6164e0102cbfd4a8ca0761e885faa72a
5
5
  SHA512:
6
- metadata.gz: 61fd6ebec19502a5160627811938fdcca59c4fdeceed34eaea0f9cc1869d85aa9a6280ea98ae1a984bd6b2733a083c643976fd10c210c93c4aee304ba5d8bd6c
7
- data.tar.gz: 0ca15aefdd13ae67dd6c90ab67e4fd98f6d6fd3a0c72bc0da7f2983b32cd16a4c2a585daf5d0bddd7b8465695e0cdb5fcc67627da729aefc13e58a76719f5837
6
+ metadata.gz: 1cd84c20274deae0cb6105f37d5872c590de9a888ade90715e84be42a72f3a4c4e270dd5a3a412621845fa195c7cd15fedf6237a7fd0c7153c3bbd1e10b85b42
7
+ data.tar.gz: a3feba17ee4f6253718e95d1902d5edad010899228b4783e97c3e344ee736360edb9ecddef811bfeecfb534a32d7b1e74b4cfb8050ad8d50209d67ba6362484d
data/README.md CHANGED
@@ -141,10 +141,9 @@ kept, in memory up to 128 KiB and in a temporary file beyond that, so
141
141
  Rack versions expect. Raw socket hijacking
142
142
  (`rack.hijack`) is not supported; the connection always belongs to Envoy.
143
143
 
144
- A response body that fails after its headers are already on the wire can only
145
- stop: a dynamic module cannot reset a stream it has started answering, so the
146
- client receives a short body rather than an error. Applications that can fail
147
- partway through should send their own length or checksum.
144
+ A response body that fails after its headers are already on the wire resets
145
+ the stream, so the client sees an error rather than a short body that looks
146
+ complete.
148
147
 
149
148
  ## Blocking calls
150
149
 
@@ -274,8 +273,31 @@ one request overlap. A repeated response header arrives as an Array.
274
273
  - A response body over `max_response_bytes`, or over Envoy's own buffer limit,
275
274
  raises `Ruvoy::UpstreamResponseTooLarge`, a subclass of `Ruvoy::UpstreamError`,
276
275
  so a caller can tell asking for less apart from trying again later.
277
- - Responses are buffered whole, so `max_response_bytes` bounds what one call
278
- can hold in memory.
276
+ - `call` buffers the response whole, so `max_response_bytes` bounds what one
277
+ call can hold in memory.
278
+
279
+ `stream` takes the same arguments and returns once the response head is in.
280
+ The body yields the response as it arrives and can be returned as the Rack
281
+ response, so a proxy is one line:
282
+
283
+ ```ruby
284
+ run ->(env) { env["ruvoy.upstream"].stream("api", env["REQUEST_METHOD"], env["PATH_INFO"], body: env["rack.input"]) }
285
+ ```
286
+
287
+ - The request body may be a String or anything that responds to `read`, such
288
+ as `rack.input`. One that ends within its first 64 KiB goes with its length,
289
+ an empty one as none, and a longer one chunked while the response comes down.
290
+ - `idle_timeout:` bounds the wait for the head and between chunks, `timeout_ms`
291
+ by default, and raises `Ruvoy::UpstreamTimeout`. `timeout:` bounds the whole
292
+ exchange and is unset by default: Envoy answers 504 before the head, and
293
+ resets the stream after it.
294
+ - Envoy applies no flow control to a stream a module starts, so at most
295
+ `upstream.stream_buffer_bytes` (default 1 MiB) of the response waits for a
296
+ slow reader. Past that the stream is reset and the reader gets
297
+ `Ruvoy::UpstreamOverflow`. The request body is held to the same budget until
298
+ Envoy takes it; what Envoy buffers after that is not bounded by Ruvoy.
299
+ - Closing the body before its end, or finishing the request, resets the
300
+ stream. `body.trailers` holds the upstream's trailers once the body has ended.
279
301
 
280
302
  [`examples/extensions`](examples/extensions) runs both against a stand-in
281
303
  service, including two calls from one request overlapping.
Binary file
data/lib/ruvoy/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module Ruvoy
4
4
  # Kept in step with the Cargo workspace version by test/e2e/cli_test.rb: the
5
5
  # gem and the module it carries are the same release.
6
- VERSION = "0.2.0"
6
+ VERSION = "0.2.1"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruvoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Zixin Zhou