#`park` in async_runtime

3 messages · Page 1 of 1 (latest)

quaint topaz
#

Hi there,

I have a long running task inside tauri::async_runtime::spawn. In some cases, I would like to pause the task.

Is there any way to use park or any similar method to pause and resume a task?

Thank you

rigid pike
#

If you want one that doesn't block when the sender's buffer is full (while waiting for the receiver to empty it) then you can use std::sync::mpsc::channel instead.