-
-
Notifications
You must be signed in to change notification settings - Fork 828
Add websocket support for server functions #3656
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
Conversation
|
I just read through this all and it looks amazing. Hope you don't mind, I just pushed two commits after reviewing, as these were pretty minimal changes just knocking a few things off the CI list. The only substantive change was that we also support Axum running as WASM on JS Fetch based platforms like Deno, but My only significant feedback: The breakages in the // from this
#[server(input = Postcard, output = Postcard)]
// to this
#[server(input = PostPostcard, output = PostPostcard)]It would be nice if there were a way to do this in the macro automatically, given that the macro already has a default method (I think?) Thanks for all your work. |
Great! WASM compatibility was one of the areas I'm wasn't not sure about. I think now you should be able to implement the server trait yourself if you want to use websockets with wasm on the server
I'm hesitant to hardcode too much into the server macro. Looking at that server function call if Postcard only implement |
|
Thanks for the changes. I think this is in a good state, I've just been ticking off the last random CI things. Unless you have any other thoughts, I'm happy to merge once it's passing. |
Thanks! Looks good to me. I'm planning on some follow up PRs to make the macro logic more modular in the next few weeks |
This PR adds websocket support for server functions that simultaneously accept and emit a stream of serializable items. This requires some breaking changes around the server function trait to model the request and response type together.
TODO: