Skip to content

uni-flow 公开 API(中文注解)


uni-flow 公开 API(中文注解) / ControlFlow

Interface: ControlFlow

Defined in: core/types.ts:260

控制流拓扑:决定下一轮调度哪些 Unit、何时完成。 内建实现见 Sequential / Parallel / Router / Loop / DAG / Delegation / Composite。

Properties

type

readonly type: string

Defined in: core/types.ts:262

Flow 类型名。

Methods

isComplete()

isComplete(state): boolean

Defined in: core/types.ts:268

整个 Flow 是否已完成。

Parameters

state

SharedState

Returns

boolean


next()

next(state, completedUnits?): WorkflowUnit[]

Defined in: core/types.ts:266

根据 SharedState 与已完成集合,返回本轮应调度的 Unit 列表。

Parameters

state

SharedState

completedUnits?

Set<string>

Returns

WorkflowUnit[]


restore()

restore(cursor): void

Defined in: core/types.ts:272

从游标恢复。

Parameters

cursor

ControlFlowCursor

Returns

void


serialize()

serialize(): ControlFlowCursor

Defined in: core/types.ts:270

序列化游标。

Returns

ControlFlowCursor

MIT Licensed