Init demuxer

This commit is contained in:
2024-03-11 22:19:08 +00:00
commit d3cb7c8bf6
12 changed files with 1576 additions and 0 deletions

25
src/pipeline/builder.rs Normal file
View File

@ -0,0 +1,25 @@
use crate::demux::Demuxer;
use crate::ingress::ConnectionInfo;
use crate::pipeline::runner::PipelineRunner;
use crate::pipeline::PipelineStep;
use crate::webhook::Webhook;
#[derive(Clone)]
pub struct PipelineBuilder {
webhook: Webhook,
}
impl PipelineBuilder {
pub fn new(webhook: Webhook) -> Self {
Self { webhook }
}
pub async fn build_for(&self, info: ConnectionInfo) -> Result<PipelineRunner, anyhow::Error> {
let config = self.webhook.start(info).await?;
let mut steps: Vec<Box<dyn PipelineStep + Sync + Send>> = Vec::new();
steps.push(Box::new(Demuxer::new()));
Ok(PipelineRunner::new(steps))
}
}