19 lines
583 B
Rust
19 lines
583 B
Rust
|
|
use crossbeam::channel::{unbounded, Receiver};
|
|
use super::*;
|
|
use streammsg::InStreamMsg;
|
|
|
|
/// A stream handler registers a queue in the stream manager, and keeps the other end to
|
|
/// get InStreamData from a running input stream.
|
|
pub struct StreamHandler {
|
|
/// The receiving part of the channel on which (InStreamData) is received..
|
|
pub rx: Receiver<InStreamMsg>
|
|
}
|
|
impl StreamHandler {
|
|
/// Create new stream handler.
|
|
pub fn new(smgr: &mut StreamMgr) -> StreamHandler{
|
|
let (tx, rx) = unbounded();
|
|
smgr.addInQueue(tx);
|
|
StreamHandler{rx}
|
|
}
|
|
} |