Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ libp2p-yamux = { version = "0.47.0", path = "muxers/yamux" }
asynchronous-codec = { version = "0.7.0" }
env_logger = "0.11"
futures = "0.3.30"
futures-bounded = { version = "0.2.4" }
futures-bounded = { version = "0.3", features = ["tokio"]}
futures-rustls = { version = "0.26.0", default-features = false }
getrandom = "0.2"
if-watch = "3.2.1"
Expand Down
2 changes: 1 addition & 1 deletion protocols/autonat/src/v2/client/handler/dial_back.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct Handler {
impl Handler {
pub(crate) fn new() -> Self {
Self {
inbound: StreamSet::new(Duration::from_secs(5), 2),
inbound: StreamSet::new(|| futures_bounded::Delay::tokio(Duration::from_secs(5)), 2),
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion protocols/autonat/src/v2/client/handler/dial_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ impl Handler {
pub(crate) fn new() -> Self {
Self {
queued_events: VecDeque::new(),
outbound: FuturesMap::new(Duration::from_secs(10), 10),
outbound: FuturesMap::new(
|| futures_bounded::Delay::tokio(Duration::from_secs(10)),
10,
),
queued_streams: VecDeque::default(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion protocols/autonat/src/v2/server/handler/dial_back.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Handler {
Self {
pending_nonce: Some(cmd),
requested_substream_nonce: None,
outbound: FuturesSet::new(Duration::from_secs(10), 5),
outbound: FuturesSet::new(|| futures_bounded::Delay::tokio(Duration::from_secs(10)), 5),
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion protocols/autonat/src/v2/server/handler/dial_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ where
observed_multiaddr,
dial_back_cmd_sender,
dial_back_cmd_receiver,
inbound: FuturesSet::new(Duration::from_secs(10), 10),
inbound: FuturesSet::new(
|| futures_bounded::Delay::tokio(Duration::from_secs(10)),
10,
),
rng,
}
}
Expand Down
10 changes: 8 additions & 2 deletions protocols/dcutr/src/handler/relayed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ impl Handler {
Self {
endpoint,
queued_events: Default::default(),
inbound_stream: futures_bounded::FuturesSet::new(Duration::from_secs(10), 1),
outbound_stream: futures_bounded::FuturesSet::new(Duration::from_secs(10), 1),
inbound_stream: futures_bounded::FuturesSet::new(
|| futures_bounded::Delay::tokio(Duration::from_secs(10)),
1,
),
outbound_stream: futures_bounded::FuturesSet::new(
|| futures_bounded::Delay::tokio(Duration::from_secs(10)),
1,
),
holepunch_candidates,
attempts: 0,
}
Expand Down
2 changes: 1 addition & 1 deletion protocols/identify/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl Handler {
remote_peer_id,
events: SmallVec::new(),
active_streams: futures_bounded::FuturesSet::new(
STREAM_TIMEOUT,
move || futures_bounded::Delay::tokio(STREAM_TIMEOUT),
MAX_CONCURRENT_STREAMS_PER_CONNECTION,
),
trigger_next_identify: Delay::new(Duration::ZERO),
Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ impl Handler {
next_connec_unique_id: UniqueConnecId(0),
inbound_substreams: Default::default(),
outbound_substreams: futures_bounded::FuturesTupleSet::new(
substreams_timeout,
move || futures_bounded::Delay::tokio(substreams_timeout),
MAX_NUM_STREAMS,
),
pending_streams: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion protocols/perf/src/server/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Handler {
pub fn new() -> Self {
Self {
inbound: futures_bounded::FuturesSet::new(
crate::RUN_TIMEOUT,
move || futures_bounded::Delay::tokio(crate::RUN_TIMEOUT),
crate::MAX_PARALLEL_RUNS_PER_CONNECTION,
),
}
Expand Down
4 changes: 2 additions & 2 deletions protocols/relay/src/behaviour/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ impl Handler {
pub fn new(config: Config, endpoint: ConnectedPoint) -> Handler {
Handler {
inbound_workers: futures_bounded::FuturesSet::new(
STREAM_TIMEOUT,
move || futures_bounded::Delay::tokio(STREAM_TIMEOUT),
MAX_CONCURRENT_STREAMS_PER_CONNECTION,
),
outbound_workers: futures_bounded::FuturesMap::new(
STREAM_TIMEOUT,
move || futures_bounded::Delay::tokio(STREAM_TIMEOUT),
MAX_CONCURRENT_STREAMS_PER_CONNECTION,
),
endpoint,
Expand Down
8 changes: 4 additions & 4 deletions protocols/relay/src/priv_client/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@ impl Handler {
queued_events: Default::default(),
pending_streams: Default::default(),
inflight_reserve_requests: futures_bounded::FuturesTupleSet::new(
STREAM_TIMEOUT,
move || futures_bounded::Delay::tokio(STREAM_TIMEOUT),
MAX_CONCURRENT_STREAMS_PER_CONNECTION,
),
inflight_inbound_circuit_requests: futures_bounded::FuturesSet::new(
STREAM_TIMEOUT,
move || futures_bounded::Delay::tokio(STREAM_TIMEOUT),
MAX_CONCURRENT_STREAMS_PER_CONNECTION,
),
inflight_outbound_connect_requests: futures_bounded::FuturesTupleSet::new(
STREAM_TIMEOUT,
move || futures_bounded::Delay::tokio(STREAM_TIMEOUT),
MAX_CONCURRENT_STREAMS_PER_CONNECTION,
),
inflight_outbound_circuit_deny_requests: futures_bounded::FuturesSet::new(
DENYING_CIRCUIT_TIMEOUT,
move || futures_bounded::Delay::tokio(DENYING_CIRCUIT_TIMEOUT),
MAX_NUMBER_DENYING_CIRCUIT,
),
reservation: Reservation::None,
Expand Down
2 changes: 1 addition & 1 deletion protocols/request-response/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ where
pending_events: VecDeque::new(),
inbound_request_id,
worker_streams: futures_bounded::FuturesMap::new(
substream_timeout,
move || futures_bounded::Delay::tokio(substream_timeout),
max_concurrent_streams,
),
}
Expand Down
Loading