- (match (run-request-when run-request)
- ((? time-delta? _)
- (error "TODO"))
- ((? integer? sec)
- (let ((time (cons sec 0)))
- (error "Also TODO")))
- (((? integer? sec) . (? integer? usec))
- (error "Also also TODO"))
- (#f
- (enq! next-queue (run-request-proc run-request)))))))
+ (define (schedule-at! time proc)
+ (schedule-add! (agenda-schedule agenda) time proc))
+ (let ((request-time (run-request-when run-request)))
+ (match request-time
+ ((? time-delta? time-delta)
+ (let ((time (time-+ (agenda-time agenda)
+ time-delta)))
+ (schedule-at! time (run-request-proc run-request))))
+ ((? integer? sec)
+ (let ((time (cons sec 0)))
+ (schedule-at! time (run-request-proc run-request))))
+ (((? integer? sec) . (? integer? usec))
+ (schedule-at! request-time (run-request-proc run-request)))
+ (#f
+ (enq! next-queue (run-request-proc run-request))))))))