Files
Qiu Yuzhou 34caebf322 feat: add GUI-scoped subscription automatic updates (#1516)
* feat: add GUI-scoped subscription automatic updates

* fix: drain newly due subscription updates during a batch

* style: use segmented subscription update pickers
2026-10-25 20:21:06 +08:00

29 lines
1.5 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Foundation
/// 组合根专用依赖束:目录工作流全部实现 adapter 的唯一装配缝。
/// 生产 adapter 由组合根(MainApp)装配,测试注入 hermetic fake;
/// CatalogWorkflow 不自行创建钥匙串存储、网络获取器或提交协调器。
/// 本类型不是 UI-facing facade:视图不得引用——独立 target 拆分前,
/// 同 target 的访问纪律由 architecture deletion check 守护。
@MainActor
struct CatalogWorkflowDependencies {
/// 提交管线与运行时收敛的唯一入口;与代理运行时路径共享同一
/// committed catalog source(组合根创建并注入)。
let coordinator: CatalogCommitCoordinator
/// 受管插件提供缝(编辑面集内事实与可执行文件存在性)。
let plugins: PluginExecutableResolving
/// 订阅获取缝。
let subscriptionFetcher: SubscriptionFetching
/// Legacy 导入服务(快照发现、完成标记与原子导入)。
let legacyImportService: LegacyImportService
/// Legacy 导入提交后的 2.0 运行时边界(组合根一次性接线;独立于普通提交管线)。
let postLegacyImport: ((LegacyImportOutcome) async -> Void)?
/// 激活缝:生产 adapter 为 `ProxyRuntimeController`,测试注入假 adapter。
let activator: Activating
var subscriptionNow: () -> Date = { Date() }
var subscriptionJitter: () -> Double = { Double.random(in: 0...0.1) }
var subscriptionWait: (TimeInterval) async throws -> Void = {
try await Task.sleep(for: .seconds($0))
}
}