Is it safe and sound to add `Send` bound on returned future of async builder?
skyzh opened this issue · 2 comments
skyzh commented
It seems that the Boxed future doesn't have Send
bound, which means the the AsyncBuilder cannot be used in multi-thread tokio runtime. Does it look good to:
- add a
Send
bound by default to those futures? - ... or use some parameters to control the behavior? Like
#[self_referencing(Send)]
- ... or use
impl Future<Output = XXX>
as the return value so that the compiler can infer the originalSend
bound of the future?
Thanks for investigating into this! If possible, I can also help implement one of these solutions.
someguynamedjosh commented
Unfortunately, I don't know enough about the internals to know if such a thing would be safe.
skyzh commented
Unfortunately, I don't know enough about the internals to know if such a thing would be safe.
Thanks for your response! Let’s leave this issue open and see if anyone could shed some lights on it…