Tutorial by Examples

Some applications may want to create so-called "Fire & Forget" tasks which can be periodically triggered and do not need to return any type of value returned upon completion of the assigned task (for example, purging old temp files, rotating logs, autosaving state). In this example, w...
It is often necessary to execute a long-running task and use the result of that task once it has completed. In this example, we will create two classes: One which implements the Callable<T> interface (where T is the type we wish to return), and one which contains a main() method. AsyncValueT...
While good software design often maximizes code reusability, sometimes it can be useful to define asynchronous tasks inline in your code via Lambda expressions to maximize code readability. In this example, we will create a single class which contains a main() method. Inside this method, we will us...

Page 1 of 1