-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(jstzd): implement shutdown signal in jstzd server #688
Conversation
Codecov ReportAttention: Patch coverage is
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
05b4280
to
bf1e11c
Compare
b79b8e9
to
92a578e
Compare
bf1e11c
to
0857f6f
Compare
92a578e
to
3748079
Compare
0857f6f
to
f5fbf93
Compare
3748079
to
3e03410
Compare
3e03410
to
9c2a4a5
Compare
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.
🚀
9c2a4a5
to
54ce88f
Compare
Offline discussion: channel population is postponed to let server = JstzdServer::new(...);
server.wait().await; // <- waits indefinitely because the server is not yet running and thus there's no way to trigger the signal sender Since the whole |
Context
Part of JSTZ-168.
JSTZ-168
Description
Implement shutdown signal in jstzd server.
If a program spins up jstzd server and keeps it running, it needs a way to know when jstzd server is terminated, e.g. after someone calls the shutdown endpoint. Otherwise, the program would just hang there not knowing when it can exit. This PR adds a
wait
method to achieve that. Whenwait
finally returns, it means that jstzd server is shut down.Manually testing the PR
wait
actually works