Skip to main content

Module task

Module task 

Source
Expand description

std.task thin adapter.

Bridge implementation moved to the mlua-batteries crate (mlua_batteries::task). This module only resolves the host’s environment variables into a mlua_batteries::task::TaskConfig before delegating to mlua_batteries::task::register_with.

§Environment variables

  • AGENT_BLOCK_TASK_DRIVERasync_fn (default), async, or coroutine. Selects the default driver used by std.task.spawn when the caller does not pass opts.driver. Unparseable values silently fall back to async_fn (mirrors AGENT_BLOCK_TASK_GRACE_MS).
  • AGENT_BLOCK_TASK_GRACE_MS — default grace window (cooperative cancel → hard abort) used by std.task.with_timeout when the caller does not pass opts.grace_ms. Default: 1000 ms. Set to 0 for strict / immediate-abort semantics. Parsing is delegated to crate::bridge::config::task_grace_ms, which tracing::warn!s on unparseable values and falls back to the default.

Functions§

register