Driver of combined services

This commit is contained in:
Tony Garnock-Jones 2011-11-06 08:26:52 -05:00
parent 0c05a400f8
commit 9cf5deadeb
1 changed files with 17 additions and 0 deletions

17
both-services.rkt Normal file
View File

@ -0,0 +1,17 @@
#lang racket/base
(define (load-in-background description module)
(printf "Starting ~s...\n" description)
(thread (lambda () (dynamic-require module #f))))
(define (wait-for-completion threads)
(when (pair? threads)
(apply sync (map (lambda (t)
(handle-evt (thread-dead-evt t)
(lambda (dummy)
(wait-for-completion (remove t threads)))))
threads))))
(wait-for-completion
(list (load-in-background "DNS server" "../racket-dns/driver.rkt")
(load-in-background "SSH server" "repl-server.rkt")))