Commit 99e9eed
committed
feat(051-implement-real-task-function-dispatch-in-wfexec-cu): Implement real task function dispatch in wf_exec. Currently lookup_task_function/2 is a hardcoded mock that ignores the task name and returns fun(Ctx) -> {ok, maps:put(task_result, ok, Ctx)} end. Fix this so the executor actually calls the task function from the wf_term metadata. The compiler must propagate task metadata (the function field from task_metadata map) into the bytecode or a side-table accessible by the executor. The executor must call the real function when it encounters a task_exec opcode. ACCEPTANCE TEST: Create an escript that compiles wf_term:seq(wf_term:task(a, #{function => fun(Ctx) -> {ok, Ctx#{a_ran => true}} end}), wf_term:task(b, #{function => fun(Ctx) -> {ok, Ctx#{b_ran => true}} end})), executes it, and asserts the final context contains both a_ran and b_ran keys set to true. The test must fail with the current mock and pass after the fix. Do NOT use mocks or stubs. Write a real eunit test in test/wf_acceptance_tests.erl that verifies this.
14 files changed
Lines changed: 1703 additions & 263 deletions
File tree
- .wreckit/items
- 050-fix-8-failing-tests-in-testwftracetestserl-and-the
- 051-implement-real-task-function-dispatch-in-wfexec-cu
- 052-implement-real-loop-condition-evaluation-in-wfexec
- 053-implement-real-parallel-forkjoin-synchronization-i
- src
- test
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments