Description
Owns one generation of an application-defined Ada task type with a typed immutable input. The input copy, task object, and task finalization remain under the Run call's local Ada master.
Abort_Task
procedure Abort_Task (Subject : in out Generation_Task)
Perform "abort Subject" without retaining Subject. The adapter must return promptly; Ada may still defer the task's response to abort. A directly visible profile-conformant Abort_Task is inferred by name when omitted.
Parameters
- Subject
Application_Context
type Application_Context (<>) is limited private;
Create
function Create
(Context : not null access Application_Context;
Input : not null access constant Input_Type;
Control : not null access Generation_Control) return Generation_Task
Construct the exact application task object by limited build-in-place return. Create may choose any task discriminants from the stable typed input and context, while the returned task remains under Run's master. Create should only construct the object; an exception from Create or task activation propagates from Run for the enclosing controller to classify. A directly visible profile-conformant Create is inferred by name when the generic actual is omitted.
Parameters
- Context
- Input
- Control
Return value
Generation_Task
type Generation_Task (<>) is limited private;
Initialize
procedure Initialize (Subject : in out Generation_Task; Control : aliased in out Generation_Control)
Invoke task-specific entries or package operations immediately after activation. Initialize runs outside supervisor locks, must not retain an access to Subject, and must return for readiness and stop deadlines to remain observable.
Parameters
- Subject
Newly activated application task object
- Control
Borrowed generation control
Input_Type
type Input_Type is private;
Run
procedure Run
(Context : aliased in out Application_Context;
Input : Input_Type;
Control : aliased in out Generation_Control;
Result : out Generation_Result)
Copy Input, construct the application-defined task, and return only after its termination and task-body finalization. Flyology.Task_Results automatically classifies normal return, an exception escaping the task body, or abnormal completion; no reporting handler is required. Tasking_Error from activation propagates because no task body began and therefore no task result exists, as does any other Create exception. An Initialize exception is copied as an Unhandled_Exception and requests cooperative stop. Abort_Task is called at most once after an abort request.
Parameters
- Context
Application state retained through task finalization
- Input
Immutable value retained until the generation joins
- Control
Fresh generation readiness, stop, and outcome channel
- Result
Bounded outcome returned only after task termination
Raised exceptions
- Tasking_Error
Generation task activation failed
Task_Identity
function Task_Identity (Subject : in out Generation_Task) return Ada.Task_Identification.Task_Id
Return Subject'Identity without retaining Subject or performing a potentially blocking operation. A directly visible profile-conformant Task_Identity is inferred by name when omitted.
Parameters
- Subject