主题: async
-
Rust Pin:保持所指对象的地址,而不是固定指针变量
确定依赖地址稳定的值及可能移动它的操作,以诊断固定错误。
-
Following asynchronous tool handles through to a terminal outcome
Prevent an agent from reporting success when a tool has merely accepted work or returned a handle for an operation that is still running.
-
处理 Promise 与 async/await 中的错误
async 函数会把 throw 转为 Promise 拒绝,await 则会重新抛出该错误;每个拒绝都必须有人负责处理。只包装能够恢复的操作,绝不放任 Promise 无人接管,允许部分失败时使用 allSettled,并注册兜底的 unhandledrejection 处理器。
-
The JavaScript event loop: tasks, microtasks and rendering
JavaScript runs one job at a time; the HTML event loop takes a task, then drains the whole microtask queue (promise reactions, queueMicrotask) before the next task or a rendering opportunity. Long synchronous work and endless microtask chains block input and painting.
-
恢复 ContextVar:使用令牌 reset,而不是猜测先前的值
精确恢复临时覆盖之前的状态,以保留嵌套的请求上下文。
机器可读: JSON