Skip to content

Instantly share code, notes, and snippets.

View gepron1x's full-sized avatar

gepron1x

  • Decalium Network
  • 09:32 (UTC +03:00)
View GitHub Profile

Using CompletableFuture

CompletableFuture is a plain Java class. It represents the result of an asynchronous computation. A future object is something which will become attainable in the future. When the asynchronous computation finishes, the future is completed.

Introduced in Java 8, CompletableFuture implements the older Future and adds support for callbacks, mapping operations, and cleaner awaiting of completion. If you are using Java 9 or later, you can also use delays and timeouts, subclass CompletableFuture to change the default executor, and take advantage of more utility methods.

Callbacks and operations

What are callbacks?

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 19, 2026 06:10
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).