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:
Pierre Krieger
2018-09-04 14:53:27 +02:00
committed by GitHub
parent ee9be6f0c9
commit 75ceba7809
11 changed files with 146 additions and 70 deletions

View File

@ -152,7 +152,7 @@ fn run_dialer(opts: DialerOpts) -> Result<(), Box<Error>> {
control.dial(address, transport.with_upgrade(echo)).map_err(|_| "failed to dial")?;
tokio_current_thread::block_on_all(future).map_err(From::from)
tokio_current_thread::block_on_all(future.for_each(|_| Ok(()))).map_err(From::from)
}
fn run_listener(opts: ListenerOpts) -> Result<(), Box<Error>> {
@ -206,7 +206,7 @@ fn run_listener(opts: ListenerOpts) -> Result<(), Box<Error>> {
});
control.listen_on(opts.listen).map_err(|_| "failed to listen")?;
tokio_current_thread::block_on_all(future).map_err(From::from)
tokio_current_thread::block_on_all(future.for_each(|_| Ok(()))).map_err(From::from)
}
// Custom parsers ///////////////////////////////////////////////////////////