prosody 0.6.1-aarch64-linux → 0.7.0-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 +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +12 -0
- data/CONFIGURATION.md +6 -3
- data/README.md +14 -5
- data/lib/prosody/3.2/prosody.so +2 -2
- data/lib/prosody/3.3/prosody.so +2 -2
- data/lib/prosody/3.4/prosody.so +2 -2
- data/lib/prosody/configuration.rb +16 -0
- data/lib/prosody/state/value.rb +14 -0
- data/lib/prosody/version.rb +1 -1
- data/sig/configuration.rbs +15 -0
- data/sig/published.rbs +2 -0
- data/sig/state.rbs +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 759cb93b1bcd48f0bc4b57d0ac1c20103d1e17dc903f13f77309019ccf193538
|
|
4
|
+
data.tar.gz: 5c5c348620bbc3356efb8d782a4eed335d0a23865729d646bce2fe613b48d05a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53dd24306a97686ec0fbb47032f05f95b19bc297fc3dd4f13b9bec3e60b479ac7b9b68dd03d9076d595258578978e8d5652b7bdeb43e30ce6ff9671f47c49651
|
|
7
|
+
data.tar.gz: f7c7347d8caebe25e5b25d5acedfa246fe6d18d78414cc4c1a76329272f4eb229c084aafcf22fceed1b4cff86afed77c49c207c712d477d2f0eb479d9951bd7e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0](https://github.com/prosody-events/prosody-rb/compare/prosody/v0.6.1...prosody/v0.7.0) (2026-11-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **deps:** upgrade prosody to 0.8.0 ([#65](https://github.com/prosody-events/prosody-rb/issues/65)) ([2e2c81f](https://github.com/prosody-events/prosody-rb/commit/2e2c81fa7253e6c4eecbf822897f6ebf3ace13fb))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** upgrade dependencies ([#63](https://github.com/prosody-events/prosody-rb/issues/63)) ([eaca537](https://github.com/prosody-events/prosody-rb/commit/eaca53706bcbd9118fa5dfbb0296b9505bb11a24))
|
|
14
|
+
|
|
3
15
|
## [0.6.1](https://github.com/prosody-events/prosody-rb/compare/prosody/v0.6.0...prosody/v0.6.1) (2026-10-13)
|
|
4
16
|
|
|
5
17
|
|
data/CONFIGURATION.md
CHANGED
|
@@ -40,14 +40,17 @@ Set `subsystem` to make this client answer requests. Without it, the client cons
|
|
|
40
40
|
| Option / Environment Variable | Description | Default |
|
|
41
41
|
|-----------------------------------------|------------------------------------------------------|------------------------|
|
|
42
42
|
| `max_concurrency` / `PROSODY_MAX_CONCURRENCY` | Max messages being processed simultaneously | 32 |
|
|
43
|
-
| `max_uncommitted` / `PROSODY_MAX_UNCOMMITTED` | Max in
|
|
43
|
+
| `max_uncommitted` / `PROSODY_MAX_UNCOMMITTED` | Max decoded messages in flight across all partitions; at the limit, partitions stop reading | 64 |
|
|
44
44
|
| `timeout` / `PROSODY_TIMEOUT` | Cancel handler if it runs longer than this | 80% of stall threshold |
|
|
45
|
-
| `commit_interval` / `PROSODY_COMMIT_INTERVAL` | How often to save progress to Kafka
|
|
45
|
+
| `commit_interval` / `PROSODY_COMMIT_INTERVAL` | How often to save progress to Kafka | 1s |
|
|
46
46
|
| `poll_interval` / `PROSODY_POLL_INTERVAL` | How often to fetch new messages from Kafka | 100ms |
|
|
47
47
|
| `shutdown_timeout` / `PROSODY_SHUTDOWN_TIMEOUT` | Shutdown budget; handlers run freely until cancellation fires near the end of the timeout | 30s |
|
|
48
48
|
| `stall_threshold` / `PROSODY_STALL_THRESHOLD` | Report unhealthy if no progress for this long | 5m |
|
|
49
49
|
| `probe_port` / `PROSODY_PROBE_PORT` | HTTP port for health checks; use `false`, `:disabled`, or the environment value `none` to disable | 8000 |
|
|
50
|
-
| `statistics_interval` / `PROSODY_STATISTICS_INTERVAL` | How often librdkafka reports client statistics
|
|
50
|
+
| `statistics_interval` / `PROSODY_STATISTICS_INTERVAL` | How often librdkafka reports client statistics | 5s |
|
|
51
|
+
| `partition_prefetch` / `PROSODY_PARTITION_PREFETCH` | Bytes of fetched records that wait for each assigned partition; accepts sizes such as `128 KiB`. Fetched memory grows with the number of assigned partitions (about two times this value, plus one batch, per partition) | 128 KiB |
|
|
52
|
+
| `fetch_max_bytes` / `PROSODY_FETCH_MAX_BYTES` | Maximum bytes in one fetch response from one broker; accepts sizes such as `50 MiB` | 50 MiB |
|
|
53
|
+
| `fetch_wait` / `PROSODY_FETCH_WAIT` | How long a broker can hold a fetch request when no new records are available. A shorter wait lowers the delay for a partition that is behind, but an idle consumer sends more fetch requests | 500ms |
|
|
51
54
|
| `failure_topic` / `PROSODY_FAILURE_TOPIC` | Send unprocessable messages here (dead letter queue) | - |
|
|
52
55
|
| `idempotence_cache_size` / `PROSODY_IDEMPOTENCE_CACHE_SIZE` | Capacity of the producer idempotence cache and of the consumer deduplication cache. Consumer deduplication cannot be turned off, so the value must be at least 1 | 8192 |
|
|
53
56
|
| `idempotence_version` / `PROSODY_IDEMPOTENCE_VERSION` | Version string for cache-busting dedup hashes | 1 |
|
data/README.md
CHANGED
|
@@ -12,7 +12,7 @@ strategies, and integrated OpenTelemetry support for distributed tracing.
|
|
|
12
12
|
- **Keyed State**: Per-key value/map/deque collections that survive across events, transactional by default
|
|
13
13
|
- **Quality of Service**: Fair scheduling limits concurrency and prevents failures from starving fresh traffic. Pipeline mode adds deferred retry and monopolization detection
|
|
14
14
|
- **Distributed Tracing**: OpenTelemetry integration for tracing message flow across services
|
|
15
|
-
- **Backpressure**:
|
|
15
|
+
- **Backpressure**: Stops reading a partition when handlers fall behind
|
|
16
16
|
- **Mocking**: In-memory Kafka broker for tests (`mock: true`)
|
|
17
17
|
- **Failure Handling**: Pipeline (retry forever), Low-Latency (dead letter), Best-Effort (log and skip)
|
|
18
18
|
|
|
@@ -36,6 +36,15 @@ State definitions carry their item types through `context.state`. A bare handler
|
|
|
36
36
|
message, definition, or state handle uses `Prosody::json_value`. See the
|
|
37
37
|
[typed examples](examples/) for Ruby and companion RBS files checked by Steep.
|
|
38
38
|
|
|
39
|
+
### Kafka version
|
|
40
|
+
|
|
41
|
+
Prosody requires Kafka 4.0 or later. Consumers use the broker-side consumer
|
|
42
|
+
group protocol (KIP-848). The broker assigns partitions, and a rebalance
|
|
43
|
+
changes only the members whose partitions move. Brokers older than 4.0 do
|
|
44
|
+
not support this protocol, and the client does not fall back to the classic
|
|
45
|
+
protocol. A consumer that connects to an older broker logs a fatal error and
|
|
46
|
+
gets no partitions, so its readiness probe stays unready.
|
|
47
|
+
|
|
39
48
|
## Quick Start
|
|
40
49
|
|
|
41
50
|
```ruby
|
|
@@ -110,7 +119,7 @@ Prosody enables efficient, parallel processing of Kafka messages while maintaini
|
|
|
110
119
|
- **Partition-Level Parallelism**: Separate management of each Kafka partition
|
|
111
120
|
- **Key-Based Queuing**: Ordered processing for each key within a partition
|
|
112
121
|
- **Concurrent Processing**: Simultaneous processing of different keys
|
|
113
|
-
- **Backpressure Management**:
|
|
122
|
+
- **Backpressure Management**: Stop reading from backed-up partitions
|
|
114
123
|
|
|
115
124
|
## Quality of Service
|
|
116
125
|
|
|
@@ -627,7 +636,7 @@ State operations look synchronous. They yield the current fiber while Prosody pe
|
|
|
627
636
|
|
|
628
637
|
| Collection | JSON payload | Kafka message | Main operations |
|
|
629
638
|
| --- | --- | --- | --- |
|
|
630
|
-
| Value | `Prosody.value` | `Prosody.message_value` | `get`, `set`, `clear` |
|
|
639
|
+
| Value | `Prosody.value` | `Prosody.message_value` | `get`, `exist?`, `set`, `clear` |
|
|
631
640
|
| Ordered string map | `Prosody.map` | `Prosody.message_map` | `get`, `get_many`, `key?`, `contains_many`, `empty?`, `set`, `delete`, `each_pair`, `each_key`, `clear` |
|
|
632
641
|
| Ordered string set | `Prosody.set` | - | `add` / `<<`, `delete`, `include?`, `contains_many`, `empty?`, `each`, `clear` |
|
|
633
642
|
| Deque | `Prosody.deque` | `Prosody.message_deque` | `push`, `unshift`, `pop`, `shift`, `get`, `length`, `each`, `clear` |
|
|
@@ -1265,7 +1274,7 @@ Definition constructors (each returns a frozen definition object used both in `C
|
|
|
1265
1274
|
|
|
1266
1275
|
Each constructor returns a `StateDefinition`. It exposes `name`, `kind`, `payload`, all supplied options, and `to_state_config`.
|
|
1267
1276
|
|
|
1268
|
-
Published readers take the user key as their first argument. `Prosody::PublishedValue` provides `get
|
|
1277
|
+
Published readers take the user key as their first argument. `Prosody::PublishedValue` provides `get` and `exist?`.
|
|
1269
1278
|
|
|
1270
1279
|
`Prosody::PublishedMap` provides `get`, `get_many`, `key?`, `has_key?`, `include?`, `member?`, `contains_many`, and `empty?`.
|
|
1271
1280
|
|
|
@@ -1279,7 +1288,7 @@ Traversal methods return an `Enumerator` without a block. Every traversal accept
|
|
|
1279
1288
|
|
|
1280
1289
|
`Prosody::ValueState`:
|
|
1281
1290
|
|
|
1282
|
-
- `get` / `value`, `set(value)` / `value=`, `clear`, `commit`, and `rollback`
|
|
1291
|
+
- `get` / `value`, `exist?`, `set(value)` / `value=`, `clear`, `commit`, and `rollback`
|
|
1283
1292
|
|
|
1284
1293
|
`Prosody::MapState` (keys are `String`):
|
|
1285
1294
|
|
data/lib/prosody/3.2/prosody.so
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/prosody/3.2/prosody.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 37990664 bytes
|
|
4
|
+
sha256: 9833ae65a879d0ed8c8efe9be81ce6d475514e048eb323b1564540aeceeab3c6
|
data/lib/prosody/3.3/prosody.so
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/prosody/3.3/prosody.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 38003144 bytes
|
|
4
|
+
sha256: 42f8eea6248fec902c829d0eae3cc81bae1dbc1a2191a18ee32092c5133ad08a
|
data/lib/prosody/3.4/prosody.so
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/prosody/3.4/prosody.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 37978008 bytes
|
|
4
|
+
sha256: 93dcdc7aad88187cd07476fe2a9798ae32420c35b5a047e09818cba029f7eef5
|
|
@@ -128,6 +128,22 @@ module Prosody
|
|
|
128
128
|
# Env: PROSODY_STATISTICS_INTERVAL. Default: 5 seconds.
|
|
129
129
|
config_param :statistics_interval, converter: ->(v) { duration_converter(v) }
|
|
130
130
|
|
|
131
|
+
# Bytes of fetched records that wait for each assigned partition, such as
|
|
132
|
+
# "128 KiB". Fetched memory grows with the number of assigned partitions:
|
|
133
|
+
# about two times this value, plus one batch, per partition.
|
|
134
|
+
# Env: PROSODY_PARTITION_PREFETCH. Default: 128 KiB.
|
|
135
|
+
config_param :partition_prefetch, converter: lambda(&:to_s)
|
|
136
|
+
|
|
137
|
+
# Maximum bytes in one fetch response from one broker, such as "50 MiB".
|
|
138
|
+
# Env: PROSODY_FETCH_MAX_BYTES. Default: 50 MiB.
|
|
139
|
+
config_param :fetch_max_bytes, converter: lambda(&:to_s)
|
|
140
|
+
|
|
141
|
+
# How long a broker can hold a fetch request when no new records are
|
|
142
|
+
# available (in seconds). A shorter wait lowers the delay for a partition
|
|
143
|
+
# that is behind, but an idle consumer sends more fetch requests.
|
|
144
|
+
# Env: PROSODY_FETCH_WAIT. Default: 0.5 seconds.
|
|
145
|
+
config_param :fetch_wait, converter: ->(v) { duration_converter(v) }
|
|
146
|
+
|
|
131
147
|
# Base delay for retry operations (in seconds).
|
|
132
148
|
config_param :retry_base, converter: ->(v) { duration_converter(v) }
|
|
133
149
|
|
data/lib/prosody/state/value.rb
CHANGED
|
@@ -16,6 +16,13 @@ module Prosody
|
|
|
16
16
|
# @return [Object, nil] the stored value, or `nil` when absent
|
|
17
17
|
def get = @native.get
|
|
18
18
|
|
|
19
|
+
# Returns true when the handle holds a value, including a buffered write.
|
|
20
|
+
# The check does not decode the value. For a message value, it does not
|
|
21
|
+
# fetch the Kafka message.
|
|
22
|
+
#
|
|
23
|
+
# @return [Boolean]
|
|
24
|
+
def exist? = @native.contains
|
|
25
|
+
|
|
19
26
|
# Buffers a write of the value.
|
|
20
27
|
#
|
|
21
28
|
# @param value [Object] the value to store (JSON, or a message)
|
|
@@ -54,5 +61,12 @@ module Prosody
|
|
|
54
61
|
# @param key [String] the user key
|
|
55
62
|
# @return [Object, nil] the value, or +nil+ when it is absent
|
|
56
63
|
def get(key) = @native.get(key)
|
|
64
|
+
|
|
65
|
+
# Returns true when a committed value exists for +key+. The check does not
|
|
66
|
+
# decode the value.
|
|
67
|
+
#
|
|
68
|
+
# @param key [String] the user key
|
|
69
|
+
# @return [Boolean]
|
|
70
|
+
def exist?(key) = @native.contains(key)
|
|
57
71
|
end
|
|
58
72
|
end
|
data/lib/prosody/version.rb
CHANGED
data/sig/configuration.rbs
CHANGED
|
@@ -67,6 +67,21 @@ module Prosody
|
|
|
67
67
|
def statistics_interval: () -> Float?
|
|
68
68
|
def statistics_interval=: (Numeric) -> Float
|
|
69
69
|
|
|
70
|
+
# Bytes of fetched records that wait for each assigned partition. Accepts
|
|
71
|
+
# a human-readable size. Uses PROSODY_PARTITION_PREFETCH when omitted.
|
|
72
|
+
def partition_prefetch: () -> String?
|
|
73
|
+
def partition_prefetch=: (String | _ToS) -> String
|
|
74
|
+
|
|
75
|
+
# Maximum bytes in one fetch response from one broker. Accepts a
|
|
76
|
+
# human-readable size. Uses PROSODY_FETCH_MAX_BYTES when omitted.
|
|
77
|
+
def fetch_max_bytes: () -> String?
|
|
78
|
+
def fetch_max_bytes=: (String | _ToS) -> String
|
|
79
|
+
|
|
80
|
+
# How long a broker can hold a fetch request when no new records are
|
|
81
|
+
# available (seconds). Uses PROSODY_FETCH_WAIT when omitted.
|
|
82
|
+
def fetch_wait: () -> Float?
|
|
83
|
+
def fetch_wait=: (Numeric) -> Float
|
|
84
|
+
|
|
70
85
|
# Base delay for retry operations (seconds)
|
|
71
86
|
def retry_base: () -> Float?
|
|
72
87
|
def retry_base=: (Numeric) -> Float
|
data/sig/published.rbs
CHANGED
|
@@ -2,6 +2,7 @@ module Prosody
|
|
|
2
2
|
# --- published-state readers, opened by Client#state -------------------
|
|
3
3
|
class NativePublishedValue
|
|
4
4
|
def get: (String key) -> json_value?
|
|
5
|
+
def contains: (String key) -> bool
|
|
5
6
|
end
|
|
6
7
|
|
|
7
8
|
class NativePublishedMap
|
|
@@ -32,6 +33,7 @@ module Prosody
|
|
|
32
33
|
|
|
33
34
|
class PublishedValue[T = json_value]
|
|
34
35
|
def get: (String key) -> T?
|
|
36
|
+
def exist?: (String key) -> bool
|
|
35
37
|
|
|
36
38
|
private
|
|
37
39
|
def initialize: (NativePublishedValue native) -> void
|
data/sig/state.rbs
CHANGED
|
@@ -110,6 +110,7 @@ module Prosody
|
|
|
110
110
|
# Every op is fiber-yield async: it looks blocking but never blocks the thread.
|
|
111
111
|
class ValueState[T = json_value] < State::Handle
|
|
112
112
|
def get: () -> T?
|
|
113
|
+
def exist?: () -> bool
|
|
113
114
|
def set: (T value) -> void
|
|
114
115
|
def clear: () -> void
|
|
115
116
|
|
|
@@ -230,6 +231,7 @@ module Prosody
|
|
|
230
231
|
|
|
231
232
|
interface _NativeValueHandle[T]
|
|
232
233
|
def get: () -> T?
|
|
234
|
+
def contains: () -> bool
|
|
233
235
|
def set: (T value) -> void
|
|
234
236
|
def clear: () -> void
|
|
235
237
|
def commit: () -> store_outcome
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: prosody
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Griffith
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async
|
|
@@ -86,14 +86,14 @@ dependencies:
|
|
|
86
86
|
requirements:
|
|
87
87
|
- - "~>"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '7.
|
|
89
|
+
version: '7.2'
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '7.
|
|
96
|
+
version: '7.2'
|
|
97
97
|
description: |
|
|
98
98
|
Prosody offers Ruby bindings to the Prosody Kafka client, providing features
|
|
99
99
|
for message production and consumption, including configurable retry
|