diff --git a/racketmq/hub.rkt b/racketmq/hub.rkt index 3d06127..ee59e83 100644 --- a/racketmq/hub.rkt +++ b/racketmq/hub.rkt @@ -24,10 +24,19 @@ (spawn-configuration filename)]) (actor #:name 'main + (during (config (list 'canonical-host $h $p)) (assert (canonical-local-host h p)) (assert (local-host h p))) + + (define/query-set canonical-local-hosts ($ c (canonical-local-host _ _)) c) + (stop-when (rising-edge (> (set-count (canonical-local-hosts)) 1)) + (log-error "Too many canonical-host records in configuration.")) + ;; TODO: Make the too-many-canonical-host-records situation recoverable. + ;; TODO: And/or, make the whole application quit when it gets into a bad state. + (during (config (list 'accepted-host $h $p)) (assert (local-host h p))) + (during (local-host $host-name $port) (assert (vh host-name port))))