MCPcopy Index your code
hub / github.com/goinaction/code / writer

Method writer

chapter7/patterns/semaphore/semaphore.go:184–197  ·  view source on GitHub ↗

writer is a goroutine that listens on the shutdown channel and performs writes until the channel is signaled.

()

Source from the content-addressed store, hash-verified

182// writer is a goroutine that listens on the shutdown channel and
183// performs writes until the channel is signaled.
184func (rw *readerWriter) writer() {
185 // Schedule the call to Done for once the method returns.
186 defer rw.reportShutdown.Done()
187
188 for {
189 select {
190 case <-rw.shutdown:
191 log.Printf("%s\t: #> Writer Shutdown", rw.name)
192 return
193 default:
194 rw.performWrite()
195 }
196 }
197}
198
199// performWrite performs the actual write work.
200func (rw *readerWriter) performWrite() {

Callers 1

startFunction · 0.95

Calls 1

performWriteMethod · 0.95

Tested by

no test coverage detected