Skip to content

Commit

Permalink
fixed side input udf await
Browse files Browse the repository at this point in the history
Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubhamdixit863 committed Dec 11, 2023
1 parent cf06a16 commit e208b3e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/sideinput-udf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::path::Path;
use tonic::{async_trait};
use tokio::spawn;


const DIR_PATH: &str = "/var/run/numaflow/sideinput.sock";
struct UdfMapper {}
#[async_trait]
Expand All @@ -20,21 +19,22 @@ impl Mapper for UdfMapper {
}
#[tokio::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
let udf_map=UdfMapper{};
start_uds_server(udf_map).await?;

// Spawn the file watcher task
spawn(async {
match file_watcher() {
match file_watcher().await {
Ok(_) => println!("File watcher is running"),
Err(e) => println!("File watcher error: {:?}", e),
}
});

let udf_map=UdfMapper{};
start_uds_server(udf_map).await?;

Ok(())
}


fn file_watcher() -> Result<()>{
async fn file_watcher() -> Result<()>{
let mut watcher = notify::recommended_watcher(|res| {
match res {
Ok(event) => println!("event: {:?}", event),
Expand Down

0 comments on commit e208b3e

Please sign in to comment.