-
Notifications
You must be signed in to change notification settings - Fork 49
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
NettyHttpService exit immediately after started #92
Comments
Hi,
The server started with daemon threads, which is intentional. Depending on
your application needs, you can block the JVM exit any way you like. One
simple way is to use a CountDownLatch:
CountDownLatch latch = new CountDownLatch(1);
Runtime.getRuntime().addShutdownHook(new Thread(latch::countDown));
NettyHttpService service = NettyHttpService.builder(...)....build();
service.start();
latch.await();
service.stop();
Terence
…On Mon, Jul 20, 2020 at 7:18 PM Ebot Tabi ***@***.***> wrote:
Trying to start the http service but it exit immediately. What's the
recommended approach to start?
[image: image]
<https://user-images.githubusercontent.com/351587/88005219-c4c67380-cb00-11ea-97ec-96fbcdcda077.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#92>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGYCKBHUQWKNHNKS75A2BDR4T3ITANCNFSM4PDBEY6Q>
.
--
Terence Yim | Staff Software Engineer | [email protected] |
|
Thanks Terence for the suggestion. |
Resolved two years ago. Close? Generally, this repo and its issues could need some love (maintenance). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to start the http service but it exit immediately. What's the recommended approach to start?
The text was updated successfully, but these errors were encountered: