render_to_string_await_suspense
does not implement Send
or Sync
#540
Labels
render_to_string_await_suspense
does not implement Send
or Sync
#540
Describe the bug
sycamore::web::render_to_string_await_suspense
doesn't implement eitherSend
norSync
, which is needed for usage in some server contexts.To Reproduce
Expected behavior
I would expect this function to implement these traits so that it can be neatly and cleanly used in web servers that take advantage of threading for the task executor.
Environment
Additional context
I've had a look at how you would go about making the function implement these traits, and it's not pleasant. Glancing at the SSR implementation, I've found too many places where
!Send
or!Sync
things are used, so it looks like it'd need a significant rework and I'm honestly not sure if it's super worth it (especially with the added overhead it would introduce).There are ways to get about this using a
LocalPoolHandle
fromtokio-utils
, so it certainly isn't a blocker, but I'm not super certain that is the best way to get around it (async Rust is something I'm still ramping up on). If it's not worth reworking the SSR internals to make it all nice and Snync (send sync), then there should at least be some docs saying that it doesn't implement these traits and mentioning where to go to get around this fact.Example workaround:
The text was updated successfully, but these errors were encountered: