netty-http
netty-http copied to clipboard
NettyHttpService exit immediately after started
Trying to start the http service but it exit immediately. What's the recommended approach to start?
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 [email protected] 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 https://github.com/cdapio/netty-http/issues/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).