-
Notifications
You must be signed in to change notification settings - Fork 15
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
runtime: remove needless 'static bounds #17
Conversation
The current_thread runtime's `block_on` and `block_on_std` functions have `'static` bounds on the input future type. These are unnecessary, since the inner tokio 0.2 runtime doesn't require these bounds, and they aren't required by tokio 0.1, breaking API compatibility. Signed-off-by: Eliza Weisman <[email protected]>
Similarly, futures passed to the threadpool's `run` also don't need `'static` bounds. This commit removes them. Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
Fixed: - Removed unnecessary `'static` bounds on the `current_thread` runtime's `block_on`/`block_on_std` functions that broke API compatibility with Tokio 0.1 (#17) Added: - Implementation of `futures` 0.1 `Executor` trait for `TaskExecutor`s (#18) Signed-off-by: Eliza Weisman <[email protected]>
Fixed: - Removed unnecessary `'static` bounds on the `current_thread` runtime's `block_on`/`block_on_std` functions that broke API compatibility with Tokio 0.1 (#17) Added: - Implementation of `futures` 0.1 `Executor` trait for `TaskExecutor`s (#18) Signed-off-by: Eliza Weisman <[email protected]>
@@ -169,7 +167,7 @@ where | |||
F: Future<Output = ()> + Send + 'static, | |||
{ | |||
let mut runtime = Runtime::new().expect("failed to start new Runtime"); | |||
runtime.block_on_std(future); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change caused a breaking change for us. Not sure that was intended, but in certain scenarios our futures would never return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jatsrt as I mentioned in 1f2137b#commitcomment-36749058, that definitely wasn't intended — this wasn't supposed to cause any change in behavior. Can you open a new issue (with example code that reproduces this, if possible?)
The current_thread runtime's
block_on
andblock_on_std
functionshave
'static
bounds on the input future type. These are unnecessary,since the inner tokio 0.2 runtime doesn't require these bounds, and they
aren't required by tokio 0.1, breaking API compatibility.
Similarly, futures passed to the threadpool's
run
also don't need'static
bounds. This commit removes them.Signed-off-by: Eliza Weisman [email protected]