1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
//! The configuration module represents the various options that an NSQ consumer //! can contain. /// NsqConfig contains values supported by `nsqd` for consumers. // TODO: Do we want the Builder derive? #[derive(Builder, Debug)] pub struct NsqConfig { max_in_flight: usize, } impl Default for NsqConfig { fn default() -> NsqConfig { NsqConfig { max_in_flight: 1 } } } // Get style functions. impl NsqConfig { /// Return the current max in flight value. pub fn max_in_flight(&self) -> usize { self.max_in_flight } }