Using Embedded Jetty, I don't understand what server.join()
does.
If I remove it, nothing happen, my server continue to work and keep serving requests.
What server.join()
does? What happens if I remove it? In which case I would like to have it?
Here an example from the official Jetty documentation:
public static void main(String[] args) throws Exception
{
int port = ExampleUtil.getPort(args, "jetty.http.port", 8080);
Server server = new Server(port);
server.setHandler(new HelloWorld());
server.start();
server.join();
}
I know the question was already asked here but the accepted answer has -6
upvotes so I thought it's worth asking it again.