When we create an HTTP server inside a verticle, then does it mean that the event loop thread creates this server? If not what is the work of the event loop and who creates this HTTP server? When we create multiple instances of a vertice, then what happens to the event loop?
Q1. When we create an HTTP server inside a verticle, then does it mean that the event loop thread creates this server?
A: No
Q2. If not what is the work of the event loop ?
In a standard reactor implementation there is a single event loop thread which runs around in a loop delivering all events to all handlers as they arrive. Vert.x works differently here. Instead of a single event loop, each Vertx instance maintains several event loops. By default we choose the number based on the number of available cores on the machine, but this can be overridden.
The event loop thread is used to dispatch events to handlers.
Q3. Who creates this HTTP server?
A: Creating an HTTP server is done from the Vertx instance. The method used is createHttpServer()
HttpServer server = vertx.createHttpServer();
Q4. When we create multiple instances of a verticle, then what happens to the event loop?
The function of the event loop threads remain the same. With many vertical instances, there are just more event loop threads.
Images are gotten from this post, which I would also recommend to go through.