mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-30 10:11:33 +00:00
feat(swarm): Make executor for connection tasks explicit (#3097)
Previously, the executor for connection tasks silently defaulted to a `futures::executor::ThreadPool`. This causes issues such as https://github.com/libp2p/rust-libp2p/issues/2230. With this patch, we force the user to choose, which executor they want to run the connection tasks on which results in overall simpler API with less footguns. Closes #3068.
This commit is contained in:
@ -291,7 +291,7 @@ fn build_relay() -> Swarm<Relay> {
|
||||
|
||||
let transport = upgrade_transport(MemoryTransport::default().boxed(), local_public_key);
|
||||
|
||||
Swarm::new(
|
||||
Swarm::with_threadpool_executor(
|
||||
transport,
|
||||
Relay {
|
||||
ping: ping::Behaviour::new(ping::Config::new()),
|
||||
@ -318,7 +318,7 @@ fn build_client() -> Swarm<Client> {
|
||||
local_public_key,
|
||||
);
|
||||
|
||||
Swarm::new(
|
||||
Swarm::with_threadpool_executor(
|
||||
transport,
|
||||
Client {
|
||||
ping: ping::Behaviour::new(ping::Config::new()),
|
||||
|
Reference in New Issue
Block a user