Fix task action handling
Refactor actions to remove context
This commit is contained in:
parent
f2f88ce0dc
commit
b463a828be
3 changed files with 8 additions and 8 deletions
|
@ -28,15 +28,16 @@
|
|||
((_ description (action arg ...) kwarg ...)
|
||||
(task%
|
||||
description
|
||||
(lambda (conn ctx)
|
||||
(action conn (resolve-context-refs ctx arg) ...))
|
||||
(lambda (ctx)
|
||||
(action (resolve-context-refs ctx arg) ...))
|
||||
kwarg ...))))
|
||||
|
||||
(define (run-task conn ctx task)
|
||||
(match task
|
||||
(define (run-task conn ctx t)
|
||||
(match t
|
||||
(($ <task> description action register triggers)
|
||||
(format #t "RUNNING TASK ~a~%" description)
|
||||
(let ((result (action conn ctx)))
|
||||
(pk 'action action)
|
||||
(let ((result ((action ctx) conn)))
|
||||
(when register
|
||||
(register-context-var! ctx register result))
|
||||
(when triggers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue