solid-resp-ractor 0.1.0 → 0.1.2

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: 5a7e50be310bd21524ea7a372f0f47b4d463d78ab6710df53a807433fa64c096
4
- data.tar.gz: 88310b01fef02d445ac6a7c1c7d5b097bdcb68c80b8657c65dff638b1d9b090a
3
+ metadata.gz: b60bbdda36dcfb824384648ffe600be6bbcce2f082dc4d2fb77c708296be575f
4
+ data.tar.gz: d844d03a09614fb46c9e664f3f03019e643d40ef9b6a184453f8d723b2404474
5
5
  SHA512:
6
- metadata.gz: 0fe96b665160e1ea048e3fd18a1f6dc43a09423e7aceb6e5a27898590edfcbdc39ae798235cac25b5ec33a64e685dd7ccef4c8147c77823eda426aced1cd9522
7
- data.tar.gz: 211d591e7acc734020c4641dd33915f7991ac55aa3bddcf674a5001eab4d1f0c91e2959e9f3beb036da17b971b970ec9dc1c4af4d11e787e279e947cf9036ee0
6
+ metadata.gz: 7437e129809ba046ba1a8b8e0f81e325de4cce0f1ac83d88d475184e67df358eb293211c8db64d09460dd4518db15b7409a920be992cbf11bee313bc7c3e1e81
7
+ data.tar.gz: 6b15a09d6f15c4b0d082038454e862d521d35d2a81316b4accf819a36411b5e7de62297b8da41b961426eaebcffb7d9aba8f113ea21366792d7d2424602fbabb
data/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.1.2] - 2026-09-29
6
+
7
+ ### Added
8
+
9
+ - Add CI, RubyGems version, download count, and RubyDoc badges to the README.
10
+
11
+ ## [0.1.1] - 2026-09-29
12
+
13
+ ### Changed
14
+
15
+ - Compact partially consumed buffers only after 16 KiB and when the consumed
16
+ prefix occupies at least half of the buffer.
17
+ - Clarify that decoded response contents are not automatically deeply frozen
18
+ or Ractor-shareable.
19
+
20
+ ### Added
21
+
22
+ - Adversarial coverage for every frame split and EOF position, truncated
23
+ streamed values, resource limits, excessive nesting, and deterministic
24
+ generated RESP values under random fragmentation.
25
+
5
26
  ## [0.1.0] - 2026-09-29
6
27
 
7
28
  ### Added
@@ -17,4 +38,6 @@ All notable changes to this project are documented in this file.
17
38
  input, and parallel Ractors.
18
39
  - Ractor-shareable default encoder with no global mutable state.
19
40
 
41
+ [0.1.2]: https://github.com/nicolasva/solid-resp-ractor/compare/v0.1.1...v0.1.2
42
+ [0.1.1]: https://github.com/nicolasva/solid-resp-ractor/compare/v0.1.0...v0.1.1
20
43
  [0.1.0]: https://github.com/nicolasva/solid-resp-ractor/releases/tag/v0.1.0
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Solid RESP Ractor
2
2
 
3
+ [![Build Status](https://github.com/nicolasva/solid-resp-ractor/actions/workflows/ci.yml/badge.svg)](https://github.com/nicolasva/solid-resp-ractor/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/solid-resp-ractor.svg)](https://rubygems.org/gems/solid-resp-ractor)
5
+ [![Downloads](https://img.shields.io/gem/dt/solid-resp-ractor?style=flat)](https://rubygems.org/gems/solid-resp-ractor)
6
+ [![Documentation Status](https://img.shields.io/badge/docs-RubyDoc.info-blue.svg)](https://www.rubydoc.info/gems/solid-resp-ractor)
7
+
3
8
  `solid-resp-ractor` is a dependency-free RESP2/RESP3 codec for Ruby. It keeps
4
9
  protocol parsing independent from Redis client behavior and provides explicit
5
10
  extension points for transports, event loops, error hierarchies, value
@@ -76,6 +81,12 @@ reader = codec.reader(socket, read_timeout: 1.0)
76
81
  `SolidRespRactor::DEFAULT_CODEC` is Ractor-shareable. A custom codec is also
77
82
  shareable when all injected collaborators are shareable.
78
83
 
84
+ Decoded responses are not automatically Ractor-shareable. Typed wrappers are
85
+ frozen, but mutable strings, arrays, hashes, and nested values they contain are
86
+ not deeply frozen. Transform a response explicitly with
87
+ `Ractor.make_shareable` (copying it first when mutation must remain possible)
88
+ before sending it to another Ractor.
89
+
79
90
  ## Reading RESP streams
80
91
 
81
92
  The default reader accepts blocking IO objects such as `StringIO`, as well as
@@ -250,7 +261,16 @@ ractor.take
250
261
 
251
262
  Create sockets and readers inside their owning Ractor. Custom handlers,
252
263
  encoders, selectors, and clocks must themselves be Ractor-shareable if they
253
- are passed between Ractors.
264
+ are passed between Ractors. Responses remain local to the reader's Ractor
265
+ unless the application explicitly transforms them into shareable values.
266
+
267
+ ## Buffer management
268
+
269
+ The reader advances a virtual cursor through buffered bytes. It clears a fully
270
+ consumed buffer immediately and compacts a partially consumed buffer only
271
+ after at least 16 KiB have been consumed and that prefix occupies at least half
272
+ of the buffer. This avoids copying a large unread suffix after small fragmented
273
+ reads while still releasing consumed data during long-lived streams.
254
274
 
255
275
  ## Development
256
276
 
@@ -3,6 +3,7 @@
3
3
  module SolidRespRactor
4
4
  class Reader
5
5
  CRLF = "\r\n"
6
+ COMPACT_THRESHOLD = 16 * 1024
6
7
 
7
8
  attr_reader :source
8
9
 
@@ -312,7 +313,8 @@ module SolidRespRactor
312
313
  end
313
314
 
314
315
  def compact_buffer
315
- return if @offset.zero?
316
+ return if @offset < COMPACT_THRESHOLD
317
+ return if @offset < @buffer.bytesize / 2
316
318
 
317
319
  @buffer = @buffer.byteslice(@offset..) || +""
318
320
  @offset = 0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidRespRactor
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid-resp-ractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Vandenbogaerde