forked from ZeraGmbH/Blockly.Net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIScript.cs
More file actions
66 lines (56 loc) · 1.73 KB
/
IScript.cs
File metadata and controls
66 lines (56 loc) · 1.73 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using BlocklyNet.Scripting.Engine;
using BlocklyNet.Scripting.Logging;
namespace BlocklyNet.Scripting;
/// <summary>
/// Interface provided by any script.
/// </summary>
public interface IScript
{
/// <summary>
/// The unique identifier of the active script.
/// </summary>
string JobId { get; }
/// <summary>
/// Can be used to check for early termination.
/// </summary>
StartScriptOptions? Options { get; }
/// <summary>
/// Set group information of the script.
/// </summary>
/// <param name="status">Group information collected.</param>
void SetGroups(ScriptGroupStatus? status);
/// <summary>
/// Report the related request.
/// </summary>
StartScript Request { get; }
/// <summary>
/// Engine executing this script.
/// </summary>
IScriptSite Engine { get; }
}
/// <summary>
/// Type interface to a script.
/// </summary>
/// <typeparam name="TLogType">Type of a log entry.</typeparam>
public interface IScript<TLogType> : IScript where TLogType : ScriptLoggingResult
{
/// <summary>
/// Logging entry for this script.
/// </summary>
TLogType ResultForLogging { get; }
/// <summary>
/// Set the outcome of the script.
/// </summary>
/// <param name="result">Outcome of the script.</param>
Task SetResultAsync(ScriptExecutionResultTypes result);
/// <summary>
/// Update the current script status in the database.
/// </summary>
/// <returns>Unique identifier of the log record.</returns>
Task<string> WriteToLogAsync();
/// <summary>
/// Register a nested script.
/// </summary>
/// <param name="id">Unique identifier of the nested scripts log entry.</param>
Task RegisterChildAsync(string id);
}