-
Notifications
You must be signed in to change notification settings - Fork 28
Move from StreamObj to Pin<Box<dyn Future>> #6
Comments
It looks like |
@Nemo157 yep, that's accurate. I take it this means we can't move away from |
Oh, looking back at rust-lang/futures-rs#1352 I remember I proposed adding a separate helper for spawning boxed futures to avoid the double indirection: trait SpawnExt {
fn spawn_box(&mut self, future: BoxFuture<'static, ()>) -> Result<(), SpawnError> { ... }
} Since EDIT: In fact, even without adding that API I guess I believe the long-term plan for fn spawn(&mut self, future: dyn Future<Output = ()> + 'static) -> Result<(), SpawnError>; it is actually possible to declare that API today using the With that API it is then up to the implementor how to allocate space for the future, the simplest solution would be to just I don't remember where this was previously discussed, I'll try and find some references for it later. One thing that needs to be checked is what the migration plan was, I expect |
@Nemo157 thanks for the detailed response! Def sounds tricky; but yeah I'm also not opposed to having some minor perf regressions if we can later speed it back up again. |
I don't understand exact reasoning for deprecating it if it forces users to use boxed futures always. Having |
|
Ah my bad I mistook it for |
Well, a bit more accurately |
As per rust-lang/futures-rs#1352 and rust-lang/futures-rs#1494 FutureObj is going to be deprecated. We should update our usage to use
BoxFuture
instead.The text was updated successfully, but these errors were encountered: