FAQ
Yes to all of your questions.
On Wednesday, May 18, 2016 at 3:07:53 PM UTC+3, Manlio Perillo wrote:

Il giorno mercoledì 18 maggio 2016 13:54:22 UTC+2, Rayland ha scritto:
func main() {

profiler := profile.Start()

var (
id int32 = 0
connCount int32 = 0
)


c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, syscall.SIGTERM)
go func() {
<-c
fmt.Println("total messages received:", totalMsgCount)
profiler.Stop()
os.Exit(1)
}()


I did something like this.
Are you *always* stopping the program with a signal?
Do you see the "total messages received" message on stdout?
Do you see the "profile: caught interrupt, stopping profiles" message on
stderr?
[...]
Manlio
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 13 of 15 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 17, '16 at 2:36p
activeMay 20, '16 at 1:17p
posts15
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase