Package org.eclipse.jface.util
Class Throttler
- java.lang.Object
-
- org.eclipse.jface.util.Throttler
-
public class Throttler extends Object
A utility class that throttles the execution of a runnable in the UI thread.- Since:
- 3.14
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
throttledExec()
Schedules the wrapped runnable to be run after the configured wait time or do nothing if it has already been scheduled but not executed yet.
-
-
-
Constructor Detail
-
Throttler
public Throttler(Display display, Duration minWaitTime, Runnable runnable)
Initializes a new throttler object that will throttle the execution of the given runnable in theUI thread
of the given display. The throttler will ensure that the runnable will not run more than everyminWaitTime
, even if it isexecuted
more often.- Parameters:
display
- the display owning the thread onto which the runnable will be executed.minWaitTime
- the minimum duration between each execution of the given runnable.runnable
- the runnable to throttle.
-
-