Skip to content

Conversation

@bittcrafter
Copy link
Collaborator

Version & Core:

  • Bumped workspace version from 0.13.3 to 0.13.4

Performance Improvements:

  • Changed offline_messages from Vec to VecDeque for efficient FIFO operations
  • Replaced pop() with pop_front() for proper queue behavior
  • Used push_back() instead of push() for correct queue ordering

Key Benefits:

  1. Efficiency: VecDeque provides O(1) amortized time for both ends
  2. Correctness: Ensures proper first-in-first-out delivery of offline messages
  3. Memory: Better memory utilization for queue operations
  4. Behavior: Maintains message ordering during offline storage and retrieval

The changes ensure that offline messages are processed in the correct order while improving performance for queue operations.

Version & Core:
- Bumped workspace version from 0.13.3 to 0.13.4

Performance Improvements:
- Changed offline_messages from Vec to VecDeque for efficient FIFO operations
- Replaced pop() with pop_front() for proper queue behavior
- Used push_back() instead of push() for correct queue ordering

Key Benefits:
1. **Efficiency**: VecDeque provides O(1) amortized time for both ends
2. **Correctness**: Ensures proper first-in-first-out delivery of offline messages
3. **Memory**: Better memory utilization for queue operations
4. **Behavior**: Maintains message ordering during offline storage and retrieval

The changes ensure that offline messages are processed in the correct order while improving performance for queue operations.
…row checking

API Consistency:
- Added explicit lifetime annotations to HTTP API Message::decode()
- Added missing allow(dead_code) for AtomicFlags methods

Type Safety:
- Added lifetime parameter to last_will() return type in ConnectInfo
- Added explicit lifetimes to plugin manager methods:
  * get() -> EntryRef<'_>
  * get_mut() -> EntryRefMut<'_>
  * iter() -> EntryIter<'_>

Key Benefits:
1. **Clarity**: Makes lifetime relationships explicit in function signatures
2. **Safety**: Helps Rust compiler verify proper borrow checking rules
3. **Consistency**: Uniform lifetime annotation patterns across codebase
4. **Maintenance**: Reduces potential lifetime-related bugs

The changes improve code robustness by making lifetime dependencies explicit without altering runtime behavior.
Code Simplification:
- Removed unnecessary curly braces around `matches()` calls in all bridge implementations:
  * Kafka egress bridge
  * MQTT egress bridge
  * NATS egress bridge
  * Pulsar egress bridge
  * ReductStore egress bridge

Pattern Matching Improvements:
- Removed redundant `ref` patterns in Pulsar ingress bridge:
  * Simplified `RemoteProperties(name, ref placeholder)` → `RemoteProperties(name, placeholder)`
  * Simplified `RemotePayload(path, ref placeholder)` → `RemotePayload(path, placeholder)`
  * Removed unnecessary `ref` keyword for string parameters

Key Benefits:
1. **Readability**: Cleaner, more idiomatic Rust code
2. **Performance**: Eliminates unnecessary scoping blocks
3. **Consistency**: Uniform pattern matching style across bridges
4. **Maintenance**: Reduced cognitive load for future changes

The changes maintain identical functionality while improving code clarity and consistency across all bridge components.
@bittcrafter bittcrafter merged commit f029a7d into rmqtt:release/0.13.x Aug 22, 2025
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant