concurrent scheduler foundation

This commit is contained in:
lda
2026-05-22 00:57:04 +07:00 Verified
parent fbeb762ce9
commit 617eb90ed9
11 changed files with 1178 additions and 40 deletions
+11 -8
View File
@@ -5,6 +5,7 @@ from copy import deepcopy
from wf_core.models.workflow import Workflow
from wf_core.paths import set_nested_value
from wf_core.run_state import ExecutionFrame, FrameStatus, RunState, RunStatus
from wf_core.runtime.scheduler import add_frame
def create_run_state(workflow: Workflow, workflow_input: dict[str, object]) -> RunState:
@@ -18,16 +19,18 @@ def create_run_state(workflow: Workflow, workflow_input: dict[str, object]) -> R
status=RunStatus.PENDING,
workflow_input=dict(workflow_input),
state=state,
frames={
"root": ExecutionFrame(
id="root",
kind="workflow",
node_id=workflow.start,
status=FrameStatus.PENDING,
)
},
current_frame_id="root",
current_node_id=workflow.start,
)
add_frame(
run,
ExecutionFrame(
id="root",
kind="workflow",
node_id=workflow.start,
status=FrameStatus.PENDING,
),
ready=True,
)
run.sync_from_current_frame()
return run