::Hash>>,
pool: Arc,
format: OutputFormat,
) where
C: UsageProvider + HeaderMetadata + BlockchainEvents,
>::Error: Display,
P: TransactionPool + MallocSizeOf,
{
let mut display = display::InformantDisplay::new(format.clone());
let client_1 = client.clone();
let display_notifications = interval(Duration::from_millis(5000))
.filter_map(|_| async {
let status = network.status().await;
status.ok()
})
.for_each(move |net_status| {
let info = client_1.usage_info();
if let Some(ref usage) = info.usage {
trace!(target: "usage", "Usage statistics: {}", usage);
} else {
trace!(
target: "usage",
"Usage statistics not displayed as backend does not provide it",
)
}
trace!(
target: "usage",
"Subsystems memory [txpool: {} kB]",
parity_util_mem::malloc_size(&*pool) / 1024,
);
display.display(&info, net_status);
future::ready(())
});
futures::select! {
() = display_notifications.fuse() => (),
() = display_block_import(client).fuse() => (),
};
}
fn display_block_import(client: Arc) -> impl Future