diff --git a/src/data/cache.rs b/src/data/cache.rs index 6c81008..9fbeb9e 100644 --- a/src/data/cache.rs +++ b/src/data/cache.rs @@ -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 diff --git a/src/data/mod.rs b/src/data/mod.rs index 904152e..82c0fb4 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -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::*;