chickadee » simple-timer » register-timer-task!

register-timer-task! time jobprocedure

Registers JOB to be run after TIME has passed. Returns a reference to the task. The reference is opaque by definition - unlike srfi-120 timer-schedule!'s task identifiers. In fact it is a pair.

The job is typically a thunk to be executed. This thunk MUST NOT raise exceptions, MAY NOT block and SHOULD return ASAP. So except for simple, fast operations it should schedule the actual operation, e.g. by starting a fresh thread, and return.

If a thread is given as JOB, it will receive a timer-condition? via thread-signal!.

Undocumented: if a pigeon-hole is given as JOB a timer-condition? is unconditionally queued.