Class GTK4GlibFuture
java.lang.Object
org.eclipse.swt.internal.GTK4GlibFuture
Utility functions to allow interoperability with
CompletableFuture
and GTK4's GLib Event Loop.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tget(Display display, CompletableFuture<T> future, Duration timeout) Run the GTK4's GLib Event loop while waiting for future.get() to complete.
-
Constructor Details
-
GTK4GlibFuture
private GTK4GlibFuture()
-
-
Method Details
-
get
public static <T> T get(Display display, CompletableFuture<T> future, Duration timeout) throws TimeoutException, ExecutionException, InterruptedException Run the GTK4's GLib Event loop while waiting for future.get() to complete.- Type Parameters:
T-- Parameters:
display- Display to readAndDispatch events onfuture- to get data fromtimeout- for how long to run if non-null, ifnullthis method does not timeout.- Returns:
- The value obtained from future.get()
- Throws:
CancellationException- if this future was cancelledExecutionException- if this future completed exceptionallyInterruptedException- if the current thread was interrupted while waitingTimeoutException- if the wait timed out
-