Class LatestTaskSwingWorkerExecutor<T,R>

java.lang.Object
com.inductiveautomation.ignition.designer.mvvm.LatestTaskSwingWorkerExecutor<T,R>
Type Parameters:
T - the type of input to be processed
R - the type of result produced by the processing

@NotThreadSafe public class LatestTaskSwingWorkerExecutor<T,R> extends Object
This class is used for processing tasks in the background, ensuring that only the latest task is processed. If a new task is submitted while another is being processed, the new task will be processed immediately after the current task completes.

It is useful for scenarios where the output of only the latest task matters, such as validating user input. The current task is considered if there's a change in input while processing.

The class uses a ViewModelSwingWorkerExecutor to execute tasks asynchronously.

This class is not thread-safe and should be used from a single thread, typically the UI thread.

  • Constructor Details

  • Method Details

    • markStale

      public void markStale()
      Marks the current value as stale. In a scenario where the input is debounced, this can be used to indicate that the current input is no longer relevant and should not be processed.
    • process

      public void process(T value)