BadScript 2
Loading...
Searching...
No Matches
BadTaskRunnerApi.cs
Go to the documentation of this file.
4
6
10[BadInteropApi("Concurrent", true)]
11internal partial class BadTaskRunnerApi
12{
17
22 public BadTaskRunnerApi(BadTaskRunner runner) : this()
23 {
24 m_Runner = runner;
25 }
26
27
32 [BadMethod("GetCurrent", "Returns the Current Task")]
33 [return: BadReturn("The Current Task")]
35 {
36 return m_Runner.Current ?? BadObject.Null;
37 }
38
43 [BadMethod("Run", "Runs a Task")]
44 private void AddTask([BadParameter(description: "The Task that will be executed")] BadTask task)
45 {
46 m_Runner.AddTask(task, true);
47 }
48
55 [BadMethod("Create", "Creates a new Task")]
56 [return: BadReturn("The Created Task")]
57 private static BadTask CreateTask(BadExecutionContext caller, [BadParameter(description: "The Function that will be executed within the task.")] BadFunction func)
58 {
59 return BadTask.Create(func, caller, null);
60 }
61}
Implements a Task Object.
Definition BadTask.cs:17
static BadTask Create(BadFunction f, BadExecutionContext caller, string? name, params BadObject[] args)
Creates a new Task from a Function.
Definition BadTask.cs:290
BadTaskRunnerApi(BadTaskRunner runner)
Creates a new API Instance.
static BadTask CreateTask(BadExecutionContext caller, [BadParameter(description:"The Function that will be executed within the task.")] BadFunction func)
Creates a new Task.
readonly BadTaskRunner m_Runner
The Runner Instance.
BadObject GetCurrentTask()
Returns the Current Task.
void AddTask([BadParameter(description:"The Task that will be executed")] BadTask task)
Adds a Task to the Runner.
void AddTask(BadTask task, bool runImmediately=false)
Adds a Task to the Task Runner.
static readonly BadTaskRunner Instance
The Task Runner Instance.
The Execution Context. Every execution of a script needs a context the script is running in....
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Implements a function that can be called from the script.
Contains task/async Extensions and Integrations for the BadScript2 Runtime.
Contains Runtime Function Objects.
Contains the Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.