buffer-trigger 一个基于数量和时间的数据收集触发器
使用场景:
see tests
```rust
extern crate lazystatic; use buffertrigger::{BufferTrigger, SimpleBufferTrigger, SimpleBufferTriggerBuilder}; use log::LevelFilter; use std::{sync::Mutex, thread, time::Duration};
lazystatic! {
static ref BUFFERTRIGGER: Mutex
fn itworks() { let _ = envlogger::builder() .istest(true) .filterlevel(LevelFilter::Debug) .try_init();
thread::spawn(|| {
BUFFER_TRIGGER.lock().unwrap().listen_clock_trigger();
});
BUFFER_TRIGGER.lock().unwrap().push(1);
BUFFER_TRIGGER.lock().unwrap().push(2);
BUFFER_TRIGGER.lock().unwrap().push(3);
BUFFER_TRIGGER.lock().unwrap().push(4);
BUFFER_TRIGGER.lock().unwrap().push(5);
thread::sleep(Duration::from_secs(5));
} ```
output:
text
[1, 2]
[3, 4]
[5]
This project is still under development. The following features with the check marks are supported.
If you are concerned about an unimplemented feature, please tell me and I will finish writing it ASAP.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions