|
|
@ -1,6 +1,16 @@
|
|
|
|
//! Datatypes for the program
|
|
|
|
//! Datatypes for the program
|
|
|
|
use super::*;
|
|
|
|
use super::*;
|
|
|
|
use std::fs::Metadata;
|
|
|
|
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::*;
|
|
|
|
mod cache; pub use cache::*;
|
|
|
|
|
|
|
|
|
|
|
|