Vert.x - Event-loop
Table of Contents
About
Data Processing - Event Loop in Vertx.
- Every event loop is attached to a thread.
- By default Vert.x attaches 2 event loops per CPU core thread.
- Same thread processing: The direct consequence of 2 event loops per CPU is that a regular verticle always processes events on the same thread, so there is no need to use thread coordination mechanisms to manipulate a verticle state (e.g, Java class fields).
Vert.x calls handlers by using a thread known as an event loop.
Articles Related
Implementation
The event loop got its name from it's minimal implementation:
while (queue.waitForMessage()) {
queue.processNextMessage()
}
where queue