File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
main/java/com/github/underscore
test/java/com/github/underscore Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2027,6 +2027,16 @@ public static <T> java.util.concurrent.ScheduledFuture<T> defer(final Supplier<T
20272027 return delay (function , 0 );
20282028 }
20292029
2030+ public static java .util .concurrent .ScheduledFuture <Void > defer (final Runnable runnable ) {
2031+ return delay (new Supplier <Void >() {
2032+ @ Override
2033+ public Void get () {
2034+ runnable .run ();
2035+ return null ;
2036+ }
2037+ }, 0 );
2038+ }
2039+
20302040 public static <T > Supplier <T > throttle (final Supplier <T > function , final int waitMilliseconds ) {
20312041 class ThrottleFunction implements Supplier <T > {
20322042 private final Supplier <T > localFunction ;
Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ public Boolean call() {
186186 return true ;
187187 }
188188 });
189+ U .defer (new Runnable () { public void run () {
190+ }
191+ });
189192 }
190193
191194/*
You can’t perform that action at this time.
0 commit comments