Skip to main content

matches_in_process

Function matches_in_process 

Source
pub async fn matches_in_process<B, MkBroker, Src, MkSrc, Pub, MkPub>(
    make_broker: MkBroker,
    make_source: MkSrc,
    make_publisher: MkPub,
    redelivery_timeout: Duration,
)
where B: InProcess, MkBroker: Fn() -> B, Src: SubscriptionSource<Connected<B>> + Clone + Send, Src::Subscriber: Send, MkSrc: Fn(&str) -> Src, <Src::Subscriber as Subscriber>::Message: 'static, Pub: Publisher, MkPub: Fn(&Connected<B>) -> Pub,
Expand description

Runs suite against the server and against the broker’s in-process transport, and fails when the two answer any settlement differently.

The in-process run wraps each broker make_broker returns in InProcessBroker, so the descriptor and the publisher are the production ones and only the transport underneath differs. Everything suite says about its inputs holds for both runs.

§Examples

use std::time::Duration;

use ruststream::conformance::settlement;
use ruststream::memory::{MemoryBroker, MemorySource};

let broker = MemoryBroker::new();
settlement::matches_in_process(
    || broker.clone(),
    |name| MemorySource::new(name),
    |connected| connected.publisher(),
    Duration::ZERO,
)
.await;

§Panics

Panics when either run fails suite, and when the in-process answers differ from the live ones.