1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use super::{ThreadingReceiver, ThreadingSender};
use crate::channel::sender::ThreadingKernelSender;
use cerk::runtime::channel::{BoxedReceiver, BoxedSender};
use std::sync::mpsc::{channel, sync_channel};
pub fn new_channel_with_size(bound: usize) -> (BoxedSender, BoxedReceiver) {
let (tx, rx) = sync_channel(bound);
return (
Box::new(ThreadingSender::new(tx)),
Box::new(ThreadingReceiver::new(rx)),
);
}
pub fn new_channel_kernel_to_component() -> (BoxedSender, BoxedReceiver) {
let (tx, rx) = channel();
return (
Box::new(ThreadingKernelSender::new(tx)),
Box::new(ThreadingReceiver::new(rx)),
);
}