Skip to content

Commit

Permalink
add a method to get Executor from Scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Oct 8, 2024
1 parent 55d9979 commit 0d865a0
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.github.projectunified.minelib.scheduler.common.task.Task;

import java.util.concurrent.Executor;
import java.util.function.BooleanSupplier;

/**
Expand Down Expand Up @@ -49,4 +50,13 @@ default Task runTimer(Runnable runnable, long delay, long period) {
return true;
}, delay, period);
}

/**
* Get the executor from this scheduler
*
* @return the executor
*/
default Executor getExecutor() {
return this::run;
}
}

0 comments on commit 0d865a0

Please sign in to comment.