mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 16:48:58 +00:00
14 lines
409 B
Rust
14 lines
409 B
Rust
use crate::{UnifiedLogEntry, sinks::Sink};
|
|
use std::sync::Arc;
|
|
use tokio::sync::mpsc::Receiver;
|
|
|
|
/// Start the log processing worker thread
|
|
pub(crate) async fn start_worker(receiver: Receiver<UnifiedLogEntry>, sinks: Vec<Arc<dyn Sink>>) {
|
|
let mut receiver = receiver;
|
|
while let Some(entry) = receiver.recv().await {
|
|
for sink in &sinks {
|
|
sink.write(&entry).await;
|
|
}
|
|
}
|
|
}
|