Task Server
Jan Dvořák <mordae@anilinux.org>
Enables event-driven programming using a central poller and a number of callback procedures.
(require tasks) | package: tasks |
1 Functions
procedure
There is a default task server, so if you are not doing anything serious you can just use the functions below. It’s almost always better to use call-with-task-server or the with-task-server form instead if you really need one.
procedure
(task-server? v) → boolean?
v : any/c
procedure
(call-with-task-server proc) → any
proc : (-> any)
parameter
(current-task-server task-server) → void? task-server : task-server?
procedure
task-server : task-server? = (current-task-server)
procedure
(schedule-stop-task [task-server]) → void?
task-server : task-server? = (current-task-server)
procedure
(schedule-task proc [task-server]) → void?
proc : (-> any) task-server : task-server? = (current-task-server)
procedure
(schedule-delayed-task proc secs [ task-server]) → void? proc : (-> any) secs : real? task-server : task-server? = (current-task-server)
procedure
(schedule-recurring-task proc secs [ task-server]) → void? proc : (-> any) secs : real? task-server : task-server? = (current-task-server)
procedure
(schedule-event-task proc evt [task-server]) → void?
proc : procedure? evt : evt? task-server : task-server = (current-task-server)
procedure
(schedule-recurring-event-task proc evt [ task-server]) → void? proc : procedure? evt : evt? task-server : task-server = (current-task-server)
2 Syntactic Forms
syntax
(with-task-server body ...)
syntax
syntax
(task body ...)
syntax
(recurring-task delay body ...)
syntax
(delayed-task delay body ...)
syntax
(event-task (evt . args) body ...)
syntax
(recurring-event-task (evt . args) body ...)