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

My suggestions for APIs #1

Open
redoriental opened this issue May 28, 2023 · 5 comments
Open

My suggestions for APIs #1

redoriental opened this issue May 28, 2023 · 5 comments

Comments

@redoriental
Copy link

I have a suggestion that the same stream should only be triggered once, and then the data transmitted through the stream will pass through OnStreamData. It is also recommended that each stream carry a streamId.

@BiagioFesta
Copy link
Owner

Hi, thank you for your feedback!
Suggestions on API is a great way to improve the project (considering I've just started to work on it), so I can have a perception about real potential usage.

I could definitely add a way to retrieve the stream ID from the "handlers". Of course, streams already carry their ID, so I would be just a matter of provide a public accessor to it.

Please consider the public interface over the streams is still lacking of some functionalities: for now, I've only added basic methods for reading and writing in order to make it operable.
The general idea behind the wtransport library is to provide a very easy-to-use API, to simplify the integration with the web in Rust. The reference I have in mind is what W3C is proposing for web implementations: https://www.w3.org/TR/webtransport/

I am not quite sure I got what you mean with:

I have a suggestion that the same stream should only be triggered once

can you please provide me with more information or maybe an example?

@redoriental
Copy link
Author

I would like to design the API to be similar to WebSocket with "onStream" and "onDatagram" events, exposing a simple API to developers. Additionally, it seems that your receiving method does not currently support datagram-based communication.

@redoriental
Copy link
Author

If you can further improve it, I believe your project can have a greater impact than QUIC or NEQO.

@BiagioFesta
Copy link
Owner

BiagioFesta commented May 29, 2023

Additionally, it seems that your receiving method does not currently support datagram-based communication.

Starting support: #3

😄

@redoriental
Copy link
Author

I'm glad that you are able to enable the datagram functionality, and it's already a great success that the onStream method is triggered only once for the same stream. I believe your project will become a mainstream project for webTransport in the future.

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

No branches or pull requests

2 participants