Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
95df77e0
Unverified
Commit
95df77e0
authored
Jun 21, 2021
by
Bastian Köcher
Committed by
GitHub
Jun 21, 2021
Browse files
Remove the streamunordered crate (#3339)
The functionality is now provided by the `futures` crate.
parent
70a4469d
Pipeline
#143567
canceled with stages
in 5 minutes and 31 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Cargo.lock
View file @
95df77e0
...
...
@@ -6385,7 +6385,6 @@ dependencies = [
"sp-application-crypto",
"sp-core",
"sp-keystore",
"streamunordered",
"substrate-prometheus-endpoint",
"thiserror",
"tracing",
...
...
@@ -10052,18 +10051,6 @@ dependencies = [
"generic-array 0.14.4",
]
[[package]]
name = "streamunordered"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9394ee1338fee8370bee649f8a7170b3a56917903a0956467ad192dcf8699ca"
dependencies = [
"futures-core",
"futures-sink",
"futures-util",
"slab",
]
[[package]]
name = "string"
version = "0.2.1"
...
...
node/subsystem-util/Cargo.toml
View file @
95df77e0
...
...
@@ -14,7 +14,6 @@ parity-scale-codec = { version = "2.0.0", default-features = false, features = [
parking_lot
=
{
version
=
"0.11.1"
,
optional
=
true
}
pin-project
=
"1.0.7"
rand
=
"0.8.3"
streamunordered
=
"0.5.1"
thiserror
=
"1.0.23"
tracing
=
"0.1.26"
lru
=
"0.6.5"
...
...
node/subsystem-util/src/lib.rs
View file @
95df77e0
...
...
@@ -31,7 +31,7 @@ use polkadot_node_subsystem::{
ActiveLeavesUpdate
,
OverseerSignal
,
};
use
polkadot_node_jaeger
as
jaeger
;
use
futures
::{
channel
::{
mpsc
,
oneshot
},
prelude
::
*
,
select
,
stream
::
Stream
};
use
futures
::{
channel
::{
mpsc
,
oneshot
},
prelude
::
*
,
select
,
stream
::
{
Stream
,
SelectAll
}
};
use
futures_timer
::
Delay
;
use
parity_scale_codec
::
Encode
;
use
pin_project
::
pin_project
;
...
...
@@ -48,7 +48,6 @@ use std::{
collections
::{
HashMap
,
hash_map
::
Entry
},
convert
::
TryFrom
,
marker
::
Unpin
,
pin
::
Pin
,
task
::{
Poll
,
Context
},
time
::
Duration
,
fmt
,
sync
::
Arc
,
};
use
streamunordered
::{
StreamUnordered
,
StreamYield
};
use
thiserror
::
Error
;
pub
use
metered_channel
as
metered
;
...
...
@@ -523,7 +522,7 @@ pub enum JobsError<JobError: std::fmt::Debug + std::error::Error + 'static> {
struct
Jobs
<
Spawner
,
ToJob
>
{
spawner
:
Spawner
,
running
:
HashMap
<
Hash
,
JobHandle
<
ToJob
>>
,
outgoing_msgs
:
S
treamUnordered
<
mpsc
::
Receiver
<
FromJobCommand
>>
,
outgoing_msgs
:
S
electAll
<
mpsc
::
Receiver
<
FromJobCommand
>>
,
}
impl
<
Spawner
:
SpawnNamed
,
ToJob
:
Send
+
'static
>
Jobs
<
Spawner
,
ToJob
>
{
...
...
@@ -532,7 +531,7 @@ impl<Spawner: SpawnNamed, ToJob: Send + 'static> Jobs<Spawner, ToJob> {
Self
{
spawner
,
running
:
HashMap
::
new
(),
outgoing_msgs
:
S
treamUnordered
::
new
(),
outgoing_msgs
:
S
electAll
::
new
(),
}
}
...
...
@@ -608,17 +607,10 @@ where
type
Item
=
FromJobCommand
;
fn
poll_next
(
mut
self
:
Pin
<&
mut
Self
>
,
cx
:
&
mut
Context
)
->
Poll
<
Option
<
Self
::
Item
>>
{
loop
{
match
Pin
::
new
(
&
mut
self
.outgoing_msgs
)
.poll_next
(
cx
)
{
Poll
::
Pending
=>
return
Poll
::
Pending
,
Poll
::
Ready
(
r
)
=>
match
r
.map
(|
v
|
v
.0
)
{
Some
(
StreamYield
::
Item
(
msg
))
=>
return
Poll
::
Ready
(
Some
(
msg
)),
// If a job is finished, rerun the loop
Some
(
StreamYield
::
Finished
(
_
))
=>
continue
,
match
futures
::
ready!
(
Pin
::
new
(
&
mut
self
.outgoing_msgs
)
.poll_next
(
cx
))
{
Some
(
msg
)
=>
Poll
::
Ready
(
Some
(
msg
)),
// Don't end if there are no jobs running
None
=>
return
Poll
::
Pending
,
}
}
None
=>
Poll
::
Pending
,
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment