Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor lib.rs #4729

Merged
merged 3 commits into from
Jan 2, 2025
Merged

Refactor lib.rs #4729

merged 3 commits into from
Jan 2, 2025

Conversation

masa-koz
Copy link
Contributor

@masa-koz masa-koz commented Jan 1, 2025

Description

This pull request includes several changes to the src/lib.rs file, focusing on enhancing the Listener and Stream structs, as well as ensuring thread safety for multiple structs. The most important changes include implementing Sync and Send traits for various structs, adding new methods to the Listener and Stream structs, and modifying existing methods for better functionality.

Thread safety improvements:

  • Implemented Sync and Send traits for Registration, Configuration, Connection, Listener, and Stream structs to ensure they can be safely shared across threads.

Enhancements to Listener struct:

  • Added a Default implementation for the Listener struct to provide a default instance.
  • Separated the new method of the Listener struct into new and open to allow us to pass itself as callback's context.
  • Added new methods stop and get_local_addr to the Listener struct to provide additional functionalities for stopping the listener and retrieving the local address.

Enhancements to Stream struct:

  • Added a shutdown method to the Stream struct to allow shutting down the stream with specific flags and error codes.
  • Added new methods get_param and receive_complete to the Stream struct to retrieve parameters and mark the completion of data reception.

Testing

NA

Documentation

TBD

@masa-koz masa-koz marked this pull request as ready for review January 1, 2025 07:26
@masa-koz masa-koz requested a review from a team as a code owner January 1, 2025 07:26
@nibanks nibanks enabled auto-merge (squash) January 1, 2025 13:08
Copy link

codecov bot commented Jan 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.59%. Comparing base (b6ebb83) to head (6c38949).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4729      +/-   ##
==========================================
- Coverage   86.68%   86.59%   -0.09%     
==========================================
  Files          56       56              
  Lines       17363    17363              
==========================================
- Hits        15051    15036      -15     
- Misses       2312     2327      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nibanks nibanks merged commit 453fb17 into microsoft:main Jan 2, 2025
483 of 484 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.

2 participants