Command-line configuration
This commit is contained in:
parent
29402dfc0b
commit
1c7b80606d
|
@ -1,5 +1,8 @@
|
|||
#lang syndicate/actor
|
||||
|
||||
(require racket/cmdline)
|
||||
(require racket/set)
|
||||
|
||||
(require "private/util.rkt")
|
||||
(require "protocol.rkt")
|
||||
|
||||
|
@ -9,11 +12,16 @@
|
|||
(require/activate "hub/local-topic.rkt")
|
||||
(require/activate "hub/subscription.rkt")
|
||||
|
||||
;; Spawn configuration in parallel:
|
||||
(spawn-configuration "defaults.rktd")
|
||||
;;
|
||||
;; ... or assert the required configuration directly:
|
||||
;; (actor (assert (config (list 'canonical-host "localhost" 7827))))
|
||||
(command-line #:program "racketmq"
|
||||
|
||||
#:once-each
|
||||
["--canonical-host" host port "Specify the canonical host and port for this hub"
|
||||
(actor #:name (list 'command-line-canonical-host host port)
|
||||
(assert (config (list 'canonical-host host (string->number port)))))]
|
||||
|
||||
#:multi
|
||||
[("-c" "--config") filename "Specify a configuration file to load"
|
||||
(spawn-configuration filename)])
|
||||
|
||||
(actor #:name 'main
|
||||
(during (config (list 'canonical-host $h $p))
|
||||
|
|
|
@ -6,4 +6,4 @@ set -e
|
|||
echo "Starting RacketMQ"
|
||||
exec 2>&1
|
||||
export PLTSTDERR="$PLTSTDERR debug@racketmq info@syndicate/drivers/web error"
|
||||
exec racket hub.rkt
|
||||
exec racket hub.rkt -c live-config.rktd
|
||||
|
|
Loading…
Reference in New Issue