Created
July 2, 2015 11:19
-
-
Save purplefox/aeb4794c519e62e397d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In Vert.x 3: | |
public static void main(String[] args) { | |
Vertx.vertx().setPeriodic(1000, tid -> System.out.println("hello")); | |
} | |
//If the threads were daemon then they above would exit immediately so you'd have to do something like the following to prevent // main from exiting (or any other method that blocks the main thread) | |
public static void main(String[] args) { | |
Vertx.vertx().setPeriodic(1000, tid -> System.out.println("hello")); | |
try { | |
} catch (Exception ignore) { | |
Thread.sleep(1000000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment