Skip to content

Commit

Permalink
feat: subsumed the custom pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
howard-oc committed Apr 25, 2024
1 parent 21d1a1f commit 0685ab2
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,26 @@ pub trait ResourceRequest {
fn transform(&self, conf: &PipelineConfig) -> String;
}

pub fn run_pipeline(_request: Option<impl ResourceRequest>) -> PipelineConfig {
pub fn run_pipeline() -> PipelineConfig {
#[derive(Clone)]
pub struct MyPromise {
pub params: String,
}

impl ResourceRequest for MyPromise {
fn transform(&self, _conf: &PipelineConfig) -> String {
format!("{}", self.params)
}
}

let request = MyPromise {
params: String::from("(default)"),
};

return run_custom_pipeline(Some(request));
}

pub fn run_custom_pipeline(_request: Option<impl ResourceRequest>) -> PipelineConfig {
dotenv().ok();

let stdout = ConsoleAppender::builder().build();
Expand Down

0 comments on commit 0685ab2

Please sign in to comment.