Illustration for Medium article “Shutdown All Goroutines”
seen from Russia

seen from United States
seen from Jordan

seen from United Kingdom

seen from United Arab Emirates

seen from Malaysia
seen from Netherlands
seen from Brazil
seen from Spain
seen from Poland

seen from Brazil
seen from Netherlands
seen from Finland
seen from Maldives

seen from Romania

seen from Malaysia
seen from United States

seen from United States
seen from United States
seen from Yemen
Illustration for Medium article “Shutdown All Goroutines”

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
One of the early Feedback received for Social Paster has been that people wanted Login with Facebook functionality. And Heeding the feedback, I have started working on it. Login with Facebook funct...
A good small example of channels usage within Go for async purposes.
Banging my head against channels.
Stop goroutine by closing a quit channel
It's a good practice to stop a goroutine by closing a 'quit' channel.
doSomething := make(chan int) quit := make(chan int) go func() { select { case <- doSomething: fmt.Println("done") case <- quit: fmt.Println("quit") } }() close(quit) // stop the goroutine
It's better than sending a variable to 'quit' channel like,
quit <- 1 // stop the goroutine
because you can stop more than one goroutines by closing it.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Sleep forever
Sleep forever select{}