Update handlers to resolve context refs
This commit is contained in:
parent
b463a828be
commit
12c45b628c
2 changed files with 12 additions and 5 deletions
|
@ -16,11 +16,19 @@
|
|||
(description handler-description)
|
||||
(action handler-action))
|
||||
|
||||
(define* (handler description action)
|
||||
(define* (handler% description action)
|
||||
(make-handler description action))
|
||||
|
||||
(define (run-handler conn ctx handler)
|
||||
(match handler
|
||||
(define-syntax handler
|
||||
(syntax-rules ()
|
||||
((_ description (action arg ...))
|
||||
(handler%
|
||||
description
|
||||
(lambda (ctx)
|
||||
(action (resolve-context-refs ctx arg) ...))))))
|
||||
|
||||
(define (run-handler conn ctx h)
|
||||
(match h
|
||||
(($ <handler> description action)
|
||||
(format #t "RUNNING HANDLER ~a~%" description)
|
||||
(action conn ctx))))
|
||||
((action ctx) conn))))
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
(match t
|
||||
(($ <task> description action register triggers)
|
||||
(format #t "RUNNING TASK ~a~%" description)
|
||||
(pk 'action action)
|
||||
(let ((result ((action ctx) conn)))
|
||||
(when register
|
||||
(register-context-var! ctx register result))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue