move cache to own mod

redo-gragh
Avril 4 years ago
parent b2371f467f
commit 805b0a0f65
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -6,17 +6,6 @@ use tokio::sync::{
mpsc,
watch,
};
use tokio::time::Duration;
/// How many unprocessed insertion requests are allowed in the backlog before the insertion stream backpressures?
pub const CACHE_SEND_BUFFER_SIZE: usize = 30;
/// How many insertion requests should be grouped before emitting them all as blocks downstream.
pub const CACHE_GATE_BUFFER_SIZE: usize = 80;
/// How long should a partial block be kept in the gate buffer with an open upstream before being sent by force.
pub const CACHE_GATE_TIMEOUT: Duration = duration!(100 ms);
/// How long should the insertion stream be forced to wait before accepting new blocks to insert.
pub const CACHE_GATED_LAG: Duration = duration!(10 ms);
#[derive(Debug)]
struct INodeCache

@ -1,6 +1,16 @@
//! Datatypes for the program
use super::*;
use std::fs::Metadata;
use tokio::time::Duration;
/// How many unprocessed insertion requests are allowed in the backlog before the insertion stream backpressures?
pub const CACHE_SEND_BUFFER_SIZE: usize = 30;
/// How many insertion requests should be grouped before emitting them all as blocks downstream.
pub const CACHE_GATE_BUFFER_SIZE: usize = 80;
/// How long should a partial block be kept in the gate buffer with an open upstream before being sent by force.
pub const CACHE_GATE_TIMEOUT: Duration = duration!(100 ms);
/// How long should the insertion stream be forced to wait before accepting new blocks to insert.
pub const CACHE_GATED_LAG: Duration = duration!(10 ms);
mod cache; pub use cache::*;

Loading…
Cancel
Save