projects
/
8sync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
v0.2.0
[8sync.git]
/
8sync
/
agenda.scm
diff --git
a/8sync/agenda.scm
b/8sync/agenda.scm
index c417a40e28fdad25cf811d796a92381d4efa71e8..e747899a93f054865a319fdd4eef55d267e29b52 100644
(file)
--- a/
8sync/agenda.scm
+++ b/
8sync/agenda.scm
@@
-72,6
+72,7
@@
8sync-run 8sync-run-at 8sync-run-delay
8sync-port 8sync-port-remove
8sync-nowait
8sync-run 8sync-run-at 8sync-run-delay
8sync-port 8sync-port-remove
8sync-nowait
+ 8sleep
catch-8sync
catch-8sync
@@
-617,6
+618,11
@@
forge ahead in our current function!"
(else (raise '8sync-caught-error
orig-key orig-args orig-stacks))))))
(else (raise '8sync-caught-error
orig-key orig-args orig-stacks))))))
+;; This is sugar... and could probably be considerably
+;; simplified and optimized. But whatever.
+(define-syntax-rule (8sleep time)
+ (8sync-delay 'no-op time))
+
\f
;;; Execution of agenda, and current agenda
\f
;;; Execution of agenda, and current agenda
@@
-745,7
+751,9
@@
Also handles sleeping when all we have to do is wait on the schedule."
;; the default stop-condition?
(stop-condition stop-on-nothing-to-do)
(get-time gettimeofday)
;; the default stop-condition?
(stop-condition stop-on-nothing-to-do)
(get-time gettimeofday)
- (handle-ports update-agenda-from-select!))
+ (handle-ports update-agenda-from-select!)
+ ;; For live hacking madness, etc
+ (post-run-hook #f))
;; TODO: Document fields
"Start up the AGENDA"
(let loop ((agenda agenda))
;; TODO: Document fields
"Start up the AGENDA"
(let loop ((agenda agenda))
@@
-754,6
+762,11
@@
Also handles sleeping when all we have to do is wait on the schedule."
;; select'ing on ports.
;; We could compose over agenda-run-once and agenda-read-ports
(agenda-run-once agenda)))
;; select'ing on ports.
;; We could compose over agenda-run-once and agenda-read-ports
(agenda-run-once agenda)))
+ ;; @@: This relies on mutation at present on the queue, in the rare
+ ;; event it's used. If we ever switch to something more immutable,
+ ;; it should return a new modified agenda instead.
+ (if post-run-hook
+ (post-run-hook agenda))
(if (and stop-condition (stop-condition agenda))
'done
(let* ((agenda
(if (and stop-condition (stop-condition agenda))
'done
(let* ((agenda