1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! `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_DRIVER` — `async_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.
use *;
use ;
use crateconfig;