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

Add documentation for SyncIoBridge with examples and alternatives #6815

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Nathy-bajo
Copy link

@Nathy-bajo Nathy-bajo commented Sep 3, 2024

Motivation

The SyncIoBridge documentation lacked clarity on its usage, potentially leading to inefficient use and suboptimal performance. Users needed better guidance on when to use it and how to handle common use cases effectively.

Solution

This update enhances the SyncIoBridge documentation by:

•	Explaining its purpose and correct usage.
•	Providing practical examples and scenarios for effective use.
•	Highlighting alternatives to avoid blocking the async runtime.
•	Adding cross-references to related documentation.

These improvements aim to help users use SyncIoBridge more effectively and avoid common pitfalls.

Rendered

@Darksonn Darksonn added T-docs Topic: documentation A-tokio-util Area: The tokio-util crate M-io Module: tokio/io labels Sep 3, 2024
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I think that most of the examples added here don't actually compile. Before we can merge this, we need to make them compile. I left some suggestions on how to do that.

tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
@Nathy-bajo
Copy link
Author

Nathy-bajo commented Sep 4, 2024

Hi @hawkw.
Thank you for the suggestions! I have updated the codes.

@Nathy-bajo
Copy link
Author

Is there anything else I need to add? @hawkw @Darksonn @tglane

tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
@Nathy-bajo
Copy link
Author

Hi @Darksonn
I have updated the PR. Is there anything else needed?

@Darksonn Darksonn requested a review from hawkw September 16, 2024 20:19
@Nathy-bajo Nathy-bajo requested review from tglane and Darksonn January 21, 2025 09:42
Copy link
Contributor

@tglane tglane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting of the documentation and the examples looks about right now.

tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
tokio-util/src/io/sync_bridge.rs Outdated Show resolved Hide resolved
@Nathy-bajo Nathy-bajo requested a review from tglane January 25, 2025 15:56
@Nathy-bajo Nathy-bajo requested a review from tglane January 26, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-io Module: tokio/io T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants