pub struct ThreadBroker<C: Consumer, P: Producer> { /* private fields */ }Expand description
A configured, not-yet-running broker.
Implementations§
Source§impl<C: Consumer + 'static, P: Producer + 'static> ThreadBroker<C, P>
impl<C: Consumer + 'static, P: Producer + 'static> ThreadBroker<C, P>
Sourcepub fn start(self) -> Result<RunningBroker, BrokerError>
pub fn start(self) -> Result<RunningBroker, BrokerError>
Apply the starting split and begin sampling.
The start is deliberately coarse. Under a solving controller it is only the point at which the first rates are measured, not a position that has to be walked away from one step at a time — which is what made the starting point dominate the outcome under the previous control law. It stays biased toward the consumer because a run that never needs decode concurrency then never pays for any.
Source§impl<C: Consumer, P: Producer> ThreadBroker<C, P>
impl<C: Consumer, P: Producer> ThreadBroker<C, P>
Sourcepub fn builder(consumer: C, producer: P) -> ThreadBrokerBuilder<C, P>
pub fn builder(consumer: C, producer: P) -> ThreadBrokerBuilder<C, P>
Start configuring a broker over these two sides, from the defaults.
Sourcepub fn builder_with(
consumer: C,
producer: P,
config: BrokerConfig,
) -> ThreadBrokerBuilder<C, P>
pub fn builder_with( consumer: C, producer: P, config: BrokerConfig, ) -> ThreadBrokerBuilder<C, P>
As Self::builder, but starting from config rather than the
defaults.
A whole BrokerConfig is taken here, at construction, rather than
offered as a .config() setter. A setter would silently discard every
individual override called before it — which it did, wiping a floor of 4
back to 1 and letting a test watch the broker breach a limit it had
explicitly been given. Taking it up front leaves no ordering to get
wrong.