racket/collects/handin-server/private/hooker.ss
Eli Barzilay 2698bf52fb * checker modules are reloaded when the file changes, so there is no
longer any need to restart the server.
* Added a 'hook-file option that specifies a module providing a
  generic hook.  Useful for notifications when important things
  happen, but can be used for anything.  Reloaded on change too.

svn: r5463
2007-01-26 06:51:36 +00:00

19 lines
494 B
Scheme

(module hooker mzscheme
(require "config.ss" "logger.ss" "reloadable.ss")
(provide hook)
(define hook-file #f)
(define hook-proc #f)
(define (hook what alist)
(let ([file (get-conf 'hook-file)])
(when file
(unless (equal? file hook-file)
(set! hook-file file)
(set! hook-proc (auto-reload-procedure `(file ,(path->string file))
'hook)))
(hook-proc what (current-session) alist))))
)