public class OnlyLatestExecutor<K> extends Object
This allows you to submit a Runnable with a key. If the previous submission for that key has not yet run, it will be replaced with the latest one.
Constructor and Description |
---|
OnlyLatestExecutor(Executor exec) |
Modifier and Type | Method and Description |
---|---|
void |
execute(K key,
Runnable r)
Run something in the future, but replace it with the latest if it is taking too long
|
Copyright © 2022 The Apache Software Foundation. All rights reserved.