Dynamic Task
Represents a task that is constructed at runtime. This is useful for tasks that have runtime requirements that cannot be determined when this task is made, such as RoadRunner tasks that run on a non-structural basis.
Note some caveats of using this task is that timeout and other information related to this task is unknown until this task is run once, in which this data will be updated to match the task that was built. If this task is to run on a subsystem, it must be declared on the inner task, as DynamicTask does not have enough information to know where to run, since these allocations are done at construction.
Author
Lucas Bubner, 2024
Since
4.0.0
Inherited properties
Timeout value for an infinite task that will run forever.
Whether the task is finished or not via timeout or custom condition. Will be true regardless of the finisher being fired or not, as some tasks will handle this via finishNow().
Functions
Inherited functions
Force a task to finish immediately, and fire the onFinish() method without waiting for the next polling loop. This method is useful when your task needs to die and needs to finish up immediately. If your finisher has already been fired, this method will do nothing but ensure that the task is marked as finished.
Time in seconds since the task was started.
Get the subsystem reference that this task has elected a dependency on. Will return an Optional where if it is not present, this task is not dependent on any subsystem.
Return whether this task has elected a dependency on a subsystem or not.
Query (but not update) the finished state of the task. This will return true if the task is finished and the finisher has been fired.
Update and query the state of the task if it is finished. This will return true if the task is finished and the finisher has been fired.
Get a verbose string representation of this task, including all of its properties.
Mute task reports from the Scheduler.
Set the timeout of this task dynamically and return the task.