Skip to main content

spawn

Function spawn 

Source
pub fn spawn<D, H>(app_handle: AppHandle, handler: H)
where D: Clone + Send + Sync + Serialize + DeserializeOwned + 'static, H: BatchItemHandler<D> + 'static,
Expand description

Spawn the background batch executor as a tokio task.

The executor polls the queue at poll_interval (default 2s) and processes one batch at a time. Progress events are emitted for each item.

The BatchQueue<D> must be registered in Tauri’s managed state.