-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Holdable.java
28 lines (26 loc) · 1.46 KB
/
Holdable.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.denizenscript.denizencore.scripts.commands;
/**
* Simply used to indicate that a command can be 'held', so we don't wait for
* commands that will never mark themselves 'finished'.
*/
public interface Holdable {
// <--[language]
// @name ~Waitable
// @group Object System
// @description
// A command that is "~Waitable" (or "Holdable", or that can be "~waited for") is a command that:
// - Might potentially take a while to execute
// - Is able to perform a slowed execution (that doesn't freeze the server)
// - And so supports the "~" prefix.
//
// This is written, for example, like: - ~run MySlowScript
//
// When a command is ~waited for, the queue it's in will wait for it to complete, but the rest of the server will continue running.
// This is of course similar to the "wait" command, but that waits for the action to complete instead of simply for a period of time.
//
// Some commands, particularly those related to file operation, when ~waited for will move the file operation off-thread.
// Others may need to be on the server thread, and may split the operation into smaller segments spread out over 1 tick each or similar logic.
// Some of these commands, when NOT waited for, will freeze the server thread until the operation completes.
// Others, however, may still perform the action in a delayed/slow/off-thread manner, but simply not hold the queue.
// -->
}