Switch the telemetry to new futures (#3100)

* Switch the telemetry to new futures

* Line widths

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix Cargo.lock
This commit is contained in:
Pierre Krieger
2019-07-11 18:11:55 +02:00
committed by Gavin Wood
parent bf2551a854
commit b3dc472a9b
6 changed files with 124 additions and 88 deletions
+3
View File
@@ -36,6 +36,7 @@ use parking_lot::Mutex;
use client::{BlockchainEvents, backend::Backend, runtime_api::BlockT};
use exit_future::Signal;
use futures::prelude::*;
use futures03::stream::{StreamExt as _, TryStreamExt as _};
use keystore::Store as Keystore;
use network::NetworkState;
use log::{info, warn, debug, error};
@@ -446,6 +447,8 @@ impl<Components: components::Components> Service<Components> {
wasm_external_transport: config.telemetry_external_transport.take(),
});
let future = telemetry.clone()
.map(|ev| Ok::<_, ()>(ev))
.compat()
.for_each(move |event| {
// Safe-guard in case we add more events in the future.
let tel::TelemetryEvent::Connected = event;