mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 01:01:34 +00:00
The SwarmFuture is now a Stream (#442)
* The SwarmFuture is now a Stream * Return the produced future in the message * Remove IncomingConnection event * Pass error when failing to dial * Fix loop break mistake * Fix concern * Rename SwarmFuture to SwarmEvents * Increase type length limit * Remove todo
This commit is contained in:
@ -25,7 +25,7 @@ extern crate libp2p;
|
||||
extern crate tokio_current_thread;
|
||||
extern crate tokio_io;
|
||||
|
||||
use futures::Future;
|
||||
use futures::{Future, Stream};
|
||||
use futures::sync::oneshot;
|
||||
use std::env;
|
||||
use libp2p::core::Transport;
|
||||
@ -112,7 +112,7 @@ fn main() {
|
||||
// actually started yet. Because we created the `TcpConfig` with tokio, we need to run the
|
||||
// future through the tokio core.
|
||||
tokio_current_thread::block_on_all(
|
||||
rx.select(swarm_future.map_err(|_| unreachable!()))
|
||||
rx.select(swarm_future.for_each(|_| Ok(())).map_err(|_| unreachable!()))
|
||||
.map_err(|(e, _)| e)
|
||||
.map(|_| ()),
|
||||
).unwrap();
|
||||
|
Reference in New Issue
Block a user