How do I block the program / goroutine?
I have a program that fires off two goroutines that provide services in
the background. I then want to block the main goroutine and let them run
in the background. I don't care about clean exits. How should I do this? I
could wait on channel and then never send anything down it. I could sleep
in a loop. Neither feels quite right I thought there might be a simpler
block() function I could call?
I'm currently doing this
var i chan int
<-i
No comments:
Post a Comment