Module thread_channel

Module thread_channel 

Source
Expand description

Thread Channel for intra-process thread communication

This module provides a high-performance channel for communication between threads within the same process, using crossbeam-channel as the underlying implementation.

§Example

use ipckit::ThreadChannel;
use std::thread;

// Create an unbounded channel
let (tx, rx) = ThreadChannel::<String>::unbounded();

thread::spawn(move || {
    tx.send("Hello from thread!".to_string()).unwrap();
});

let msg = rx.recv().unwrap();
assert_eq!(msg, "Hello from thread!");

Structs§

ThreadChannel
A bidirectional thread channel that combines both sender and receiver.
ThreadReceiver
A thread-safe channel receiver for intra-process communication.
ThreadSender
A thread-safe channel sender for intra-process communication.