mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Pass executor to scheduler.
This commit is contained in:
@@ -2,8 +2,8 @@ package org.briarproject.bramble.api.system;
|
||||
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@@ -16,13 +16,16 @@ import java.util.concurrent.TimeUnit;
|
||||
public interface TaskScheduler {
|
||||
|
||||
/**
|
||||
* See {@link ScheduledExecutorService#schedule(Runnable, long, TimeUnit)}.
|
||||
* Submits the given task to the given executor after the given delay.
|
||||
*/
|
||||
Future<?> schedule(Runnable task, long delay, TimeUnit unit);
|
||||
Future<?> schedule(Runnable task, Executor executor, long delay,
|
||||
TimeUnit unit);
|
||||
|
||||
/**
|
||||
* See {@link ScheduledExecutorService#scheduleWithFixedDelay(Runnable, long, long, TimeUnit)}.
|
||||
* Submits the given task to the given executor after the given delay,
|
||||
* and then repeatedly with the given interval between executions
|
||||
* (measured from the end of one execution to the beginning of the next).
|
||||
*/
|
||||
Future<?> scheduleWithFixedDelay(Runnable task, long delay,
|
||||
long interval, TimeUnit unit);
|
||||
Future<?> scheduleWithFixedDelay(Runnable task, Executor executor,
|
||||
long delay, long interval, TimeUnit unit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user