Closed satoren closed 2 weeks ago
The pull request implements significant modifications across multiple modules in the Yex
library, focusing on enhancing the monitor_update
and related functions to accept optional metadata parameters. The changes include updating function signatures, adjusting implementations to utilize the new parameters, and ensuring that metadata can be passed and correctly processed. New test cases are added to verify the functionality of these enhancements, ensuring that the metadata is included in update messages. A new module, term_box
, is introduced to facilitate the handling of terms in a thread-safe manner.
File | Change Summary |
---|---|
lib/doc.ex | Updated monitor_update , monitor_update_v1 , and monitor_update_v2 to accept an optional keyword argument for metadata. |
lib/nif.ex | Modified doc_monitor_update_v1 , doc_monitor_update_v2 , awareness_monitor_update , and awareness_monitor_change to include a _metadata parameter. |
lib/protocols/awareness.ex | Enhanced monitor_update and monitor_change to accept an optional metadata parameter. |
native/yex/src/awareness.rs | Updated awareness_monitor_update and awareness_monitor_change to include a metadata parameter, simplifying access to it. |
native/yex/src/doc.rs | Refactored doc_monitor_update_v1 and doc_monitor_update_v2 to use observe_update_v1 and observe_update_v2 , adding a metadata parameter. |
native/yex/src/lib.rs | Added a new module term_box . |
native/yex/src/term_box.rs | Introduced TermBox struct for encapsulating terms in a thread-safe environment, including methods for initialization and retrieval. |
test/doc_test.exs | Added tests for monitor_update and monitor_update_v2 with metadata handling. |
test/protocols/awareness_test.exs | Added tests for monitor_update and monitor_change with metadata handling. |
transaction
function in the Yex.Doc
module to accept an origin
parameter aligns with the main PR's focus on enhancing function signatures to include additional parameters for metadata handling.🐇 In the code where updates reside,
A newmetadata
we now provide.
Functions enhanced, tests added too,
WithTermBox
to safely ensue.
InYex
we hop, with joy we sing,
For the changes that this PR brings! 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
Release Notes
New Features
TermBox
struct for safe term management across different environments.Bug Fixes
sub_unsubscribe
function to handle mutex poisoning scenarios effectively.Tests