-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Performance #287] Docs for throttle related classes
- Loading branch information
Showing
7 changed files
with
100 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 19 additions & 2 deletions
21
src/main/java/cz/cvut/kbss/termit/util/longrunning/LongRunningTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
package cz.cvut.kbss.termit.util.longrunning; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.time.Instant; | ||
import java.util.Optional; | ||
|
||
/** | ||
* An asynchronously running task that is expected to run for some time. | ||
*/ | ||
public interface LongRunningTask { | ||
|
||
/** | ||
* @return true when the task is being actively executed, false otherwise. | ||
*/ | ||
boolean isRunning(); | ||
|
||
/** | ||
* @return true when the task has finished, false otherwise. | ||
* Returns true regardless of whether the task succeeded. | ||
*/ | ||
boolean isCompleted(); | ||
|
||
@Nullable | ||
Instant runningSince(); | ||
/** | ||
* @return a timestamp of the task execution start, | ||
* or empty if the task execution has not yet started. | ||
*/ | ||
@NotNull | ||
Optional<Instant> runningSince(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters