Class KeyedExecutor<K>

java.lang.Object
com.atlassian.crowd.manager.webhook.KeyedExecutor<K>

public class KeyedExecutor<K> extends Object
A task executor that discards tasks if there is another existing task with the same key queued for execution. Keys must be valid Map keys, i.e., they must be immutable and have equals() and hashMap().
Since:
v2.7
  • Constructor Details

    • KeyedExecutor

      public KeyedExecutor(Executor delegateExecutor)
  • Method Details

    • execute

      public void execute(Runnable runnable, K key)
      Adds a Runnable to the executor queue. If there is another Runnable with the same key that is awaiting its execution, then the new Runnable is discarded.
      Parameters:
      runnable - the runnable task.
      key - task key. Must be immutable and have equals() and hashMap().