MCPcopy Index your code
hub / github.com/gopherdata/gophernotes / handleShutdownRequest

Function handleShutdownRequest

kernel.go:620–634  ·  view source on GitHub ↗

handleShutdownRequest sends a "shutdown" message.

(receipt msgReceipt)

Source from the content-addressed store, hash-verified

618
619// handleShutdownRequest sends a "shutdown" message.
620func handleShutdownRequest(receipt msgReceipt) {
621 content := receipt.Msg.Content.(map[string]interface{})
622 restart := content["restart"].(bool)
623
624 reply := shutdownReply{
625 Restart: restart,
626 }
627
628 if err := receipt.Reply("shutdown_reply", reply); err != nil {
629 log.Fatal(err)
630 }
631
632 log.Println("Shutting down in response to shutdown_request")
633 os.Exit(0)
634}
635
636// startHeartbeat starts a go-routine for handling heartbeat ping messages sent over the given `hbSocket`. The `wg`'s
637// `Done` method is invoked after the thread is completely shutdown. To request a shutdown the returned `shutdown` channel

Callers 1

handleShellMsgMethod · 0.85

Calls 1

ReplyMethod · 0.80

Tested by

no test coverage detected