Skip to content

[refactor][P2] AsyncFlow 的 Run/RunAsync/RunAsyncWithResults 豁免+兜底编排三写 #96

Closed

Description

@zy84338719

来源:2026-11-11 全矩阵深度代码审查(6 路并行扫描约 24 万行 Go)。判定已复核;行号基于 2026-11-11 的 main,动手前请核对现场。
归档索引:#95(本仓重构 backlog)

位置

async.go:92-174(Run/runWithHooks)、178-225(RunAsync)、270-301(RunAsyncWithResults)

证据

三处重复同一段 #82 豁免判据与 #35 取消兜底(注释也三份):if isCancellationErr(err) && (parentCtx.Err() != nil || future.canceled.Load()) { return } / if firstErr == nil && ctx.Err() != nil { firstErr = ctx.Err() }。

建议

抽 collectErrs(resultFn 装配器):把「豁免判定 + errOnce 首错 + 兜底」收敛为一个带选项的聚合器,Run(有界 drain)/RunAsync(Future)/WithResults(逐条 channel)只保留结果出口差异;豁免语义改动单点生效。

Activity

  1. added a commit that references this issue on Nov 11, 2026
  2. zy84338719 commented on Nov 11, 2026

    @zy84338719
    ContributorAuthor

    已在 v0.11.0 修复并发布 ✅

    变更内容

    本条修复(在 v0.11.0 的版本节里定位到):

    该版本 `v0.11.0` 的其余变更

    关联问题单:workflow#94、workflow#96、workflow#97、workflow#98、workflow#99。

    Release: https://github.com/oekit/workflow/releases/tag/v0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactor重构机会(代码审查产出)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions