mirror of
https://github.com/fhmq/hmq.git
synced 2026-08-29 22:13:11 +00:00
Plugins update log (#47)
* modify * update * add acl * add feature * update dockerfile * add deploy * update * update * plugins * plugins * update * update * update * fixed * remove * fixed * add log * update * fixed * update * fix config * add http api * add http api * resp * add config for work chan * update * fixed * update * disable trace * fixed * change acl * fixed * fixed res * dd * dd * ddd * dd * update * fixed * update * add * fixed * update key * add log * update * format * update * update auth * update * update readme * added * update * fixed * fixed * fix * upade * update * update * update
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/fhmq/hmq/broker"
|
||||
)
|
||||
|
||||
func main() {
|
||||
b, err := broker.NewBroker(nil)
|
||||
if err != nil {
|
||||
log.Fatal("New Broker error: ", err)
|
||||
}
|
||||
b.Start()
|
||||
|
||||
s := waitForSignal()
|
||||
log.Println("signal received, broker closed.", s)
|
||||
}
|
||||
|
||||
func waitForSignal() os.Signal {
|
||||
signalChan := make(chan os.Signal, 1)
|
||||
defer close(signalChan)
|
||||
signal.Notify(signalChan, os.Kill, os.Interrupt)
|
||||
s := <-signalChan
|
||||
signal.Stop(signalChan)
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user