jsecure
Aug 17, 2022

--

Having a go routine wait for a channel can block the execution of that goroutine and prevent it from doing things like responding to a unix kill signal. Better idea is to Jane it continuously execute a select statement where one case is to check the status of the channel carrying the signal from the broadcast function, and another case is a sleep of one second - this way you limit blocking to a max of one second.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

jsecure
jsecure

Written by jsecure

I live in London and have worked as a software developer for the last 20 years.

No responses yet

Write a response