Skip to main content

Module task

Module task 

Source
Expand description

Task management module 任务管理模块

§Overview / 概述

This module provides task spawning and management with support for:

  • Task lifecycle tracking (Running, Completed, Cancelled)
  • Wake-up notifications for async polling
  • Join handles for awaiting task completion

本模块提供任务生成和管理,支持:

  • 任务生命周期跟踪(运行中、已完成、已取消)
  • 异步轮询的唤醒通知
  • 等待任务完成的join句柄

Re-exports§

pub use crate::scheduler::TaskId;
pub use crate::scheduler::gen_task_id;

Modules§

raw_task
Raw task infrastructure for the scheduler 调度器的原始任务基础设施

Structs§

JoinHandle
Join handle for spawned tasks 生成任务的join句柄
Task
A spawned task 生成的任务

Enums§

JoinError
Error from joining a task 加入任务的错误

Functions§

block_on
Block on a future to completion 阻塞等待future完成
spawn
Spawn a new async task 生成新的异步任务