Description
Convenience adapter that turns an application procedure into one structured Ada task generation with a fixed execution model. Applications that define their own task type use Supervision.Task_Generations instead. Each call owns a fresh task object and returns only after its Ada master has joined the task and completed task-body finalization.
Application_Context
type Application_Context (<>) is limited private;
Execute
procedure Execute (Context : in out Application_Context; Control : not null access Generation_Control)
Run one application generation. Execute must call Mark_Ready only after it has acquired and validated every resource it publishes. It should pass Stopping (Control.all) to task-aware I/O and observe cancellation during CPU-only work.
Parameters
- Context
State kept alive by the enclosing supervisor scope
- Control
Borrowed generation-local readiness and stop channel
Run
procedure Run
(Context : aliased in out Application_Context;
Control : aliased in out Generation_Control;
Result : out Generation_Result)
Create, activate, observe, and join one generation. Unhandled callback exceptions are copied automatically into Result rather than propagated. Tasking_Error from activation is propagated because no generation body began and therefore no task result exists. An optional abort request is issued only when Control says so and remains subject to ordinary Ada abort deferral.
Parameters
- Context
Application state kept alive through the complete call
- Control
Fresh generation control opened by the supervisor
- Result
Bounded outcome available after the task has joined
Raised exceptions
- Tasking_Error
Generation task activation failed
Task_CPU
Task_CPU : System.Multiprocessors.CPU_Range := System.Multiprocessors.Not_A_Specific_CPU;
Task_Model
Task_Model : Flyology.Execution_Model := Flyology.Project_Default;