kafka-client-engine 0.0.1

Execution and driver-integration layer for the native Kafka client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Native host-thread acquisition and cancelled-handoff cleanup.

use std::sync::Arc;

use super::{EngineLifecycle, thread_start};

#[test]
fn dropped_startup_sender_closes_the_unowned_host_thread() {
    let lifecycle = Arc::new(EngineLifecycle::new());
    let (sender, handle) = thread_start::start(&lifecycle)
        .unwrap_or_else(|error| panic!("start host thread: {error}"));
    drop(sender);
    handle
        .join()
        .unwrap_or_else(|_panic| panic!("cancelled host thread"));
    assert!(lifecycle.is_closed());
}