跳转到主要内容

0.1.0-beta.1

首个 beta 预发布版本:奠定跨平台 Worker 适配、Scope 生命周期、优先级调度、预算账本与 ResultLease 背压模型。

0.1.0-beta.1 是 tasklane 的首个公开预发布版本,确立了跨浏览器 Web Worker 与 Node.js worker_threads 的统一任务运行时架构。

主要变化摘要

  • 跨平台统一运行时与 Scope 生命周期:提供应用级 WorkerRuntime 与可嵌套的 RuntimeScope,支持基于 released ACK 的确定性资源清理屏障。
  • 有界优先级与公平调度:支持 interactive、foreground、background 三级优先级、可选老化提升(ageing)、group 组间公平索引堆调度以及大任务预算等待保护。
  • 显式数据所有权与结果背压:通过 transferBuffers() 与 output() 显式管理 ArrayBuffer 零拷贝转移;通过 inputBytes、scratchBytes、outputBytes、cacheBytes 账本与 ResultLease 实现端到端背压。
  • 取消模式、亲和性与状态型 Session:提供 cooperative、discard、terminate 三种取消模式,支持软亲和性(affinity)、独占 WorkerSession 以及按作用域隔离的本地 ScopedCache 与 ScratchArena。
  • 协议代际与全套验证矩阵:引入 Worker epoch 代际隔离、有界进度流控、阶段耗时统计(TaskTiming),并通过 Node.js 与三大浏览器的大规模坐标转换及取消风暴测试。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

First beta release of tasklane with:

  • browser Web Worker and Node.js worker_threads adapters
  • scoped lifecycle and bounded scheduling
  • priority, ageing and fair task admission
  • explicit Transferable ownership
  • input, scratch, output and cache budgets
  • ResultLease backpressure
  • cooperative, discard and terminate cancellation modes
  • worker affinity and stateful sessions
  • worker-local bounded caches
  • protocol generation and failure handling
  • runtime metrics and timing
  • browser, stress and large-data conversion verification

Reliability and scheduling

  • Indexed group scheduling, bounded fairness history and waiting-budget protection.

  • Physical phase validation, bounded progress with ACKs, and confirmed scope cleanup (protocol v3).

  • Explicit resident-resource disposal, discarded-result tasks, lease count limits and termination recovery.

  • Independent metadata traversal limits and a real-Worker scheduler benchmark.

  • Bounded wire packets account for scalar and graph metadata; results decode on consumption.

  • Synchronous-only prepare rejects hanging promises; asynchronous preparation belongs in Worker handlers.

  • Strict priority defaults, measured scratch arenas, and metadata-aware ordinary cache accounting.

  • Deterministic Node endpoint retirement tests and real Worker error/termination races.

相关文档