using notify in tauri v2 app #10747
Answered
by
pan-grayza
pan-grayza
asked this question in
Q&A
-
I have this function that creates debouncer to notify file changes: pub async fn setup_file_watcher(
linked_paths: Vec<LinkedPath>,
tx: mpsc::Sender<LinkedPath>, // From tokio
) -> Result<(), Box<dyn std::error::Error>> {
// Create a channel to receive file events
let (notify_tx, mut notify_rx) = mpsc::channel(32); // From tokio
// Create a debouncer with an async watcher
let mut debouncer = new_debouncer(Duration::from_secs(2), None, notify_tx)?; // error here on `notify_tx`
let watcher = debouncer.watcher();
// More logic ...
Ok(())
} Where I commented there is this error:
Do I need to import something to extend traits of |
Beta Was this translation helpful? Give feedback.
Answered by
pan-grayza
Aug 24, 2024
Replies: 1 comment
-
Okay, so I needed to use synchronous |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pan-grayza
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay, so I needed to use synchronous
channel
like one fromstd
inside of my function instead of channel fromtokio