-
-
Notifications
You must be signed in to change notification settings - Fork 2
Fix quit
message not being printed
#15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -292,5 +306,8 @@ func (d *Server) outputProcessor(outWriter io.Writer) { | |||
} | |||
fmt.Fprintln(outWriter, string(data)) | |||
} | |||
// We finished consuming all messages, now | |||
// we can exit for real | |||
d.outputWaiter.Done() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about dropping the channel + goroutine + waitgroup + d.quit
in change of a mutex?
outputMutext.Lock()
output.Write(data)
outputMutex.Unlock()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be mean refactor everything again, I'd prefer to avoid that. 😖
On every push and pull request that affects relevant files, run the project's Go code tests.
89b039a
to
84341ca
Compare
84341ca
to
91f7240
Compare
Most of the
quit
successful message wasn't sent since the goroutine consuming messages to output wouldn't be fast enough.Before:
After: