Zongzi. Windowing
(zongzi v0.3.0)
Copy Markdown
渲染切片(post-rebase 瞬态闭包)的入口命名空间。
契约见 Windowing.Strategy;默认策略 Windowing.RestSplit3Beats。
决策全文:docs/zh/spec/decisions/windowing-post-rebase.md。
本层不修改 Timeline、不做 Declaration.resolve。
Summary
Functions
对同一 Context 跑一或多个 windowing 策略。
Functions
@spec run_stages(Zongzi.Windowing.Context.t(), [module()]) :: {:ok, [Zongzi.Windowing.Segment.t()]} | {:error, term()}
对同一 Context 跑一或多个 windowing 策略。
目前 zongzi 内核只提供单策略的版本。 执行多个策略一般用于针对 interv 的精确控制,前一个的 ctx 传入后一个,需要自己实现。
Fail-fast when not succeed.
Examples
# 默认单策略(RestSplit3Beats):
# {:ok, segments} = Windowing.run_stages(ctx)
# 链式多策略:
# {:ok, segments} = Windowing.run_stages(ctx, [Strategy1, Strategy2])