最新资讯
reddit.com OpenAI 称 Astra 仅满足 10% 安全任务标准 dev.to FreeToken:在自有 GPU 上运行前沿 MoE 模型及其内存需求 dev.to 当 AI Agent 说“完成”时,究竟完成了什么? dev.to 部署 Underdog Bark 3.0 Pro:逐字转写、自定义后端与分块设置 dev.to 为艰难对话构建 AI:五个 Agent、一条安全正则与一位盲评监督者 techcrunch.com Palo Alto Networks 洽谈以 5 亿美元收购 AI Agent 安全初创公司 Clutch theinformation.com 黄仁勋被要求就涉华间谍指控向国会作简报 www.infoq.com Edera 推出 Object Capability Bounded Authority,试图将凭证与 AI Agent 工作负载隔离 wechat 这波杀疯了!旗舰级模型不限量、1个月视频额度免费领 bloomberg.com AI 抛售蔓延至信用市场,软银领跌亚洲美元债 dev.to 如何在专用 GPU 服务器上用 OpenAI 兼容 API 部署 LLM dev.to 审计 153 份 Claude Code 与 Codex 会话记录:User-Agent 与 URL 中的邮箱泄露
多元动态
登录 注册
行业动态 developers.cloudflare.com · @Cloudflare Developers

Cloudflare Durable Objects:待处理 I/O 操作可在无客户端连接时保持运行

原文 我的收藏

Cloudflare 更新 Durable Objects 生命周期行为:当没有客户端连接时,待处理的 service binding 请求、通过 RPC 或 fetch() 调用其他 Durable Object、this.ctx.container.monitor()、传入 this.ctx.waitUntil() 的 Promise 以及待处理的 setTimeout/setInterval 定时器,都会阻止 Durable Object 因空闲而被关闭。此前这些操作在无客户端连接时可能被中断。该行为对兼容日期为 2026-10-01 及之后的 Workers 默认生效,更早日期需添加 durable_object_io_tasks_prevent_eviction 标志,也可用 durable_object_io_tasks_do_not_prevent_eviction 退出。每个待处理操作最多阻止驱逐 15 分钟,期间持续计费。

AI推荐理由 Cloudflare 官方 changelog 明确说明 Durable Objects 的新行为:当无客户端连接时,待处理的 service binding 请求、RPC/fetch 调用、container.monitor()、waitUntil() 以及 setTimeout/setInterval 定时器会阻止空闲驱逐,使 agent 等长任务可在客户端断开后继续运行。这是对开发者有实际用途的运行时语义变更,并给出兼容性日期与开关 flag。局限在于每个待处理操作最多阻止驱逐 15 分钟,且期间持续计费,并非无限期保活。

78

正文

Durable Objects remain active while handling a request from a connected client. This change applies when no client is connected, such as when an agent continues a submitted job after its client disconnects. This behavior is the default for Workers with a compatibility date of `2026-10-01` or later. To use it with an earlier date, add the [`durable_object_io_tasks_prevent_eviction`](https://developers.cloudflare.com/workers/configuration/compatibility-flags/#durable-object-io-tasks-prevent-eviction) compatibility flag. To opt out, add the `durable_object_io_tasks_do_not_prevent_eviction` flag. Pending [service binding](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/) requests now keep Durable Objects running while they wait for a response. Pending calls to another Durable Object through remote procedure call (RPC) or `fetch()`, as well as `this.ctx.container.monitor()`, now also keep the Durable Object running. Promises passed to `this.ctx.waitUntil()` and pending `setTimeout()` and `setInterval()` timers also receive this protection. Previously, Cloudflare could shut down an idle Durable Object while one of these operations remained pending without a connected client. This could stop unfinished work. This change helps you run long-running tasks such as agents. An agent can call tools through service bindings, coordinate with other Durable Objects, or wait for a container process without relying on the original client to remain connected. Outbound `fetch()` requests to external services, TCP sockets, and outbound WebSockets already keep Durable Objects running. Each pending operation prevents idle shutdown for up to 15 minutes. Starting another one later can extend the Durable Object's time in memory. The limit applies to each operation, not to the total time in memory. ![Timeline of a service binding fetch, an RPC call, and monitor() each preventing eviction for up to 15 minutes](https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=820,height=360,format=svg/_astro/pending-io-keep-alive.vVfDqYTX.svg) Duration charges continue while an operation prevents eviction. For more information, refer to [Lifecycle of a Durable Object](https://developers.cloudflare.com/durable-objects/concepts/durable-object-lifecycle/).

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容