-
Notifications
You must be signed in to change notification settings - Fork 6
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
Async API #90
Comments
Thanks for the suggestion! That is a good point. Unfortunately it seems to be difficult at the moment to support both sync and async code without duplicating code or running into other issues. See this very extensive blog post and the corresponding discussion on Reddit1. For now I was hoping to wait for "maybe-async", in case that is ever implemented. But this suggestion is definitely valid, so I will keep this issue here open. In case it is helpful, it looks like @hdoordt converted the API to async in their fork: https://github.com/hdoordt/struson/commits/async-read-write/ Footnotes
|
You've made a good point. I realized that maybe for the moment, that really means to maintain another repository, and would mean quite a bit more work. Thanks though. |
@Marcono1234 Thanks for the reference. My fork is mostly meant for demonstrating, and figuring out whether something like maybe-async makes sense for struson. My conclusion would be that it's not exactly trivial, but it's not that hard to do either. It's possible to do something like that with macros today, and while I'm not entirely happy by the results you'd get from something like that, it more or less boils down to a bit of plumbing |
Do you mean https://github.com/fMeow/maybe-async-rs? I will probably not use that due to fMeow/maybe-async-rs#6, since it is conceivable that users could end up with a sync and async version of Struson in their transitive dependencies, which would break their build. In the comments there are proposals to instead generate separate 'sync' and 'async' modules, and there is for example also https://github.com/JM4ier/bisync. That sounds like a better solution to me (but I am not very experienced with the topic), so there could be an But maybe something to consider for the future. Footnotes
|
struson is good for a lot of internet applications. So, async stream writer would be nice to have.
The text was updated successfully, but these errors were encountered: