The control centre of the Vert.x Core API.
You should normally only use a single instance of this class throughout your application. If you are running in the Vert.x container an instance will be provided to you.
This class acts as a factory for TCP/SSL and HTTP/HTTPS servers and clients, SockJS servers, and provides an instance of the event bus, file system and shared data classes, as well as methods for setting and cancelling timers.
Create a new Vertx instance. Instances of this class are thread-safe.
Anything
Object
Vertx
Basic
Identifiable
Object
Anything
no subtypes hierarchy
Initializer |
Vertx(Vertx delegate = ...) Parameters:
|
Attributes | |
currentContext | shared Context? currentContext The current context |
delegate | shared Vertx delegate |
eventBus | shared EventBus eventBus The event bus |
eventLoop | shared Boolean eventLoop Is the current thread an event loop thread? |
fileSystem | shared FileSystem fileSystem The File system object |
sharedData | shared SharedData sharedData The shared data object |
worker | shared Boolean worker Is the current thread an worker thread? |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
cancelTimer | shared Boolean cancelTimer(Integer id) Cancel the timer with the specified |
createHttpClient | shared HttpClient createHttpClient(Integer? port = null, String? host = null) Create a new http client and return it Parameters:
|
createHttpServer | shared HttpServer createHttpServer() Create a new http server and returns it |
createNetClient | shared NetClient createNetClient() Create a new net client and return it |
createNetServer | shared NetServer createNetServer() Create a new net server and returns it |
createSockJSServer | shared SockJSServer createSockJSServer(HttpServer server) Create a SockJS server that wraps an HTTP server |
runOnContext | shared void runOnContext(void task()) Put the handler on the event queue for the current loop (or worker context) so it will be run asynchronously ASAP after this event has been processed |
setPeriodic | shared Integer setPeriodic(Integer delay, void handle(Integer timerId)) |
setTimer | shared Integer setTimer(Integer delay, void handle(Integer timerId)) |
stop | shared void stop() Stop the eventbus and any resource managed by the eventbus. |
Inherited Methods |
Methods inherited from: Object equals |