prosody 0.2.1 → 0.4.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
- data/.release-please-manifest.json +1 -1
- data/ARCHITECTURE.md +12 -2
- data/CHANGELOG.md +20 -0
- data/Cargo.lock +586 -450
- data/Cargo.toml +6 -6
- data/README.md +211 -20
- data/Rakefile +11 -1
- data/examples/keyed_state.rb +58 -0
- data/examples/keyed_state.rbs +18 -0
- data/examples/keyed_state_windowing.rb +47 -0
- data/examples/keyed_state_windowing.rbs +16 -0
- data/ext/prosody/Cargo.toml +1 -1
- data/ext/prosody/src/client/config.rs +387 -19
- data/ext/prosody/src/handler/context.rs +146 -5
- data/ext/prosody/src/handler/message.rs +17 -0
- data/ext/prosody/src/handler/mod.rs +4 -2
- data/ext/prosody/src/handler/state.rs +1035 -0
- data/ext/prosody/src/lib.rs +1 -0
- data/lib/prosody/configuration.rb +26 -0
- data/lib/prosody/handler.rb +6 -2
- data/lib/prosody/native_stubs.rb +381 -6
- data/lib/prosody/state.rb +693 -0
- data/lib/prosody/version.rb +1 -1
- data/lib/prosody.rb +5 -0
- data/release-please-config.json +4 -0
- data/sig/configuration.rbs +24 -1
- data/sig/handler.rbs +7 -3
- data/sig/processor.rbs +28 -12
- data/sig/prosody.rbs +11 -6
- data/sig/sentry.rbs +6 -0
- data/sig/state.rbs +272 -0
- data/steep_expectations.yml +47 -0
- data/typecheck/payload_types.rb +43 -0
- data/typecheck/payload_types.rbs +20 -0
- data/typecheck_negative/payload_types.rb +16 -0
- data/typecheck_negative/payload_types.rbs +8 -0
- metadata +24 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e796ed66be2610f629c69b181c1cac30155aa0c2196de69fc7a58538816caca
|
|
4
|
+
data.tar.gz: db008d5d6e205204100eb405ebd01937772a83c1d502cac5a7ef3998bf866099
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b33f8d570c33a9172073f9ab94b8e253d6dd965cec4d06ea0637c030b6013e1c20c95c03a9715abb0de4ab1e68ba292efc3ae85e1e350d5c36d36d29c5c66ee
|
|
7
|
+
data.tar.gz: 6b8784b0f7dc8fec51a6c4f6b359df0335afb1f77abda27f8210c05a8991f994c17cca29e188a3cf733ee86f3501c24551177416922c32157dc53c081bd9d45d
|
data/ARCHITECTURE.md
CHANGED
|
@@ -79,6 +79,14 @@ end
|
|
|
79
79
|
|
|
80
80
|
When processing thousands of messages, yielding allows much higher throughput because work continues during waits.
|
|
81
81
|
|
|
82
|
+
### Keyed-State Scans Yield Per Step
|
|
83
|
+
|
|
84
|
+
Keyed-state traversal follows the same rule. `each` / `each_pair` (and their `reverse_*` variants) drive a native cursor
|
|
85
|
+
one chunk at a time: every step crosses the bridge through `Bridge::wait_for`, so the enumerating fiber yields while Rust
|
|
86
|
+
fetches the next chunk and resumes when it arrives. A scan therefore looks like an ordinary blocking loop but never blocks
|
|
87
|
+
the thread — other fibers keep running between steps — and the native cursor is closed via `ensure` when the loop
|
|
88
|
+
finishes, breaks, or raises.
|
|
89
|
+
|
|
82
90
|
## Architecture Overview
|
|
83
91
|
|
|
84
92
|
Prosody combines a Rust core with a Ruby interface:
|
|
@@ -102,8 +110,10 @@ graph TD
|
|
|
102
110
|
|
|
103
111
|
1. **Ruby Interface Layer**: The classes you interact with directly
|
|
104
112
|
- `Prosody::Client`: The main entry point for applications
|
|
105
|
-
- `Prosody::EventHandler`: Base class
|
|
106
|
-
|
|
113
|
+
- `Prosody::EventHandler[Payload]`: Base class whose RBS payload parameter
|
|
114
|
+
is propagated to each handled message
|
|
115
|
+
- `Prosody::Message[Payload]`: Represents a Kafka message with a statically
|
|
116
|
+
typed JSON payload (`Prosody::json_value` by default)
|
|
107
117
|
|
|
108
118
|
2. **Bridge**: The crucial connection between Ruby and Rust
|
|
109
119
|
- Enables safe communication between languages
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.0](https://github.com/prosody-events/prosody-rb/compare/prosody/v0.3.0...prosody/v0.4.0) (2026-07-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **state:** add durable keyed state ([#26](https://github.com/prosody-events/prosody-rb/issues/26)) ([fb68411](https://github.com/prosody-events/prosody-rb/commit/fb6841125b1cb7bb3730965254f3205109da8fbe))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **release:** preserve release history boundary ([#28](https://github.com/prosody-events/prosody-rb/issues/28)) ([257cf86](https://github.com/prosody-events/prosody-rb/commit/257cf86e532c942feda5b1ce65af78c8365064d3))
|
|
14
|
+
* **release:** restore published release boundary ([#31](https://github.com/prosody-events/prosody-rb/issues/31)) ([2f4cda1](https://github.com/prosody-events/prosody-rb/commit/2f4cda104f9cf93e28b0d6c7bd8bd66da660b789))
|
|
15
|
+
|
|
16
|
+
## [0.3.0](https://github.com/prosody-events/prosody-rb/compare/prosody/v0.2.1...prosody/v0.3.0) (2026-05-18)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **deps:** upgrade prosody to 0.4.0 ([#24](https://github.com/prosody-events/prosody-rb/issues/24)) ([4531b68](https://github.com/prosody-events/prosody-rb/commit/4531b68eda202cf00ef506bcb77ba4c53906dbce))
|
|
22
|
+
|
|
3
23
|
## [0.2.1](https://github.com/prosody-events/prosody-rb/compare/prosody/v0.2.0...prosody/v0.2.1) (2026-05-11)
|
|
4
24
|
|
|
5
25
|
|