;;; 8sync --- Asynchronous programming for Guile
-;;; Copyright (C) 2015 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright (C) 2015, 2016 Christopher Allan Webber <cwebber@dustycloud.org>
;;;
;;; This file is part of 8sync.
;;;
8sync 8sync-delay
8sync-run 8sync-run-at 8sync-run-delay
8sync-port 8sync-port-remove
+ 8sync-nowait
catch-8sync
(schedule (make-schedule))
(time (gettimeofday))
(catch-handler #f)
- (pre-unwind-handler #f))
+ (pre-unwind-handler print-error-and-continue))
;; TODO: document arguments
"Make a fresh agenda."
(make-agenda-intern queue prompt
;; TODO: Write (%run-immediately)
-(define-syntax-rule (8sync-immediate body)
+(define-syntax-rule (8sync-nowait body)
"Run body asynchronously but ignore its result...
forge ahead in our current function!"
(8sync-abort-to-prompt
(list (make-run-request
;; See comment in 8sync-port
(wrap (kont #f)) #f)
- (make-run-request body #f))))))
+ (make-run-request (lambda () body) #f))))))
(define-syntax-rule (catch-8sync exp (handler-key handler) ...)
(catch '8sync-caught-error
#:key
;; @@: Should we make stop-on-nothing-to-do
;; the default stop-condition?
- stop-condition
+ (stop-condition stop-on-nothing-to-do)
(get-time gettimeofday)
(handle-ports update-agenda-from-select!))
;; TODO: Document fields