mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-18 12:31:22 +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:
@ -99,7 +99,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
let kademlia = Kademlia::new(local_peer_id, store);
|
||||
let mdns = Mdns::new(MdnsConfig::default())?;
|
||||
let behaviour = MyBehaviour { kademlia, mdns };
|
||||
Swarm::new(transport, behaviour, local_peer_id)
|
||||
Swarm::with_async_std_executor(transport, behaviour, local_peer_id)
|
||||
};
|
||||
|
||||
// Read full lines from stdin
|
||||
|
Reference in New Issue
Block a user