-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Upgrade from futures-preview to futures 0.3.1, and remove futures 0.1 where currently possible #4083
Conversation
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.
lgtm
I'm not so worried about adding dependencies, but more about the fact that it's behind the |
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.
I'm kind of undecided about async-std
. Maybe we should depend on =0.99.12
rather than just 0.99.12
.
In practice, though, the chances of Interval
breaking are fairly low.
core/cli/src/lib.rs
Outdated
@@ -102,7 +101,7 @@ pub struct VersionInfo { | |||
/// Something that can be converted into an exit signal. | |||
pub trait IntoExit { | |||
/// Exit signal type. | |||
type Exit: Future<Item=(),Error=()> + Send + 'static; | |||
type Exit: Future<Output=()> + Unpin + Send + 'static; |
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.
As a heads up, this breaks Polkadot.
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.
Great, I'll make a PR for that then.
You might have to replace all the |
|
@tomaka ah ok. What should I do here? |
@tomaka is the webwasm stuff something that can/should be fixed in this PR? |
The WASM CI is probably failing because there's still a dependency on |
ok - @expenses you ok doing that? |
Yep! |
@@ -68,6 +67,8 @@ use prost::Message; | |||
use sr_primitives::generic::BlockId; | |||
use sr_primitives::traits::{Block as BlockT, ProvideRuntimeApi}; | |||
|
|||
type Interval = Box<dyn Stream<Item = ()> + Unpin>; |
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.
I think this is preferable to stream::Unfold<(), ...>
, but not ideal
@tomaka this should be ready now |
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.
Approving for the third time :)
As #3099 mentions, we want to switch to stable futures. While we are still blocked in several places (tokio 0.2, jsonrpc, libp2p etc), we can switch from the preview branch of futures to the proper
0.3.1
, and get away from futures0.1
in some places.Note that in order to stabilise
futures-timer
, theInterval
stream was moved intoasync-std
under theunstable
feature (as the stream api hasn't been stabilised yet). This isn't great, as it adds more dependencies than we really need. Perhaps it would be best to moveInterval
into our own lib.