← All compilation units

Flyology.Supervision.Service_Slots

Description

Publishes bounded typed service availability without storing application payloads or access-to-task values. A published lease identifies one exact supervisor controller and child generation. Application service operations must validate that lease inside the same protected object that owns the corresponding endpoint state.

Acquire

function Acquire (From : Directory; Service : Service_Kind) return Service_Observation

Atomically copy the current lease for Service.

Parameters
From

Directory to inspect

Service

Typed service to acquire

Return value

Available with an exact lease, or Unavailable

Active

function Active (Item : Publication) return Boolean

Report whether Item currently owns a publication.

Parameters
Item

Publication owner to inspect

Return value

True after Publish_Ready and before Withdraw or finalization

Availability_Status

type Availability_Status is (Unavailable, Available);

Availability returned by a service lookup.

Enumeration literals
Unavailable

No generation is currently published for the service

Available

Lease contains the exact published generation

Configuration_Error

Configuration_Error : exception;

Raised when two service kinds use the same logical child identity.

Current

function Current (From : Directory; Lease : Service_Lease) return Boolean

Check whether Lease remains the exact publication for its service. This is useful for observation and routing. It is not a substitute for validating the lease within the protected operation that mutates the application endpoint.

Parameters
From

Directory that issued Lease

Lease

Exact service lease to validate

Return value

True only while the same publication remains current

Directory

type Directory is limited private;

Fixed service directory. Storage is determined by Service_Kind and no publication, lookup, or revocation allocates memory.

Handle

function Handle (Lease : Service_Lease) return Child_Handle

Return the exact controller-qualified generation represented by Lease.

Parameters
Lease

Published service lease

Return value

Child handle carried by Lease

Logical_Id

function Logical_Id (Service : Service_Kind) return Child_Id
Parameters
Service
Return value

Publication

type Publication (From : not null access Directory) is limited private;

Controlled ownership of one publication. Finalization revokes only the exact publication created through this object; it cannot withdraw a replacement generation or another publisher's entry.

Record fields
From

Directory that must outlive the publication

Publish_Ready

procedure Publish_Ready
  (Item : in out Publication; Service : Service_Kind; Control : in out Generation_Control)

Reserve Service for Control's exact generation, report readiness, then atomically make its lease available until Item is withdrawn or finalized. Duplicate and logical-child validation occurs before readiness changes. Item's access discriminant makes From's lifetime an Ada accessibility constraint. No application callback is invoked and no allocation is performed.

Parameters
Item

Publication owner bound to its directory

Service

Typed service being published

Control

Exact generation providing the ready service

Raised exceptions
Program_Error

Item is active, Control names another logical child, Service already has a live publication, or readiness was already reported or stopping began

Service

function Service (Lease : Service_Lease) return Service_Kind

Return the typed service represented by Lease.

Parameters
Lease

Published service lease

Return value

Service key carried by Lease

Service_Kind

type Service_Kind is (<>);

Service_Lease

type Service_Lease is private;

Copyable authority to one exact published generation. A lease contains no application endpoint and cannot extend any task or resource lifetime.

Service_Observation

type Service_Observation (Status : Availability_Status := Unavailable) is record
   case Status is
      when Unavailable =>
         null;
      when Available =>
         Lease : Service_Lease;
   end case;
end record;

Atomic fixed service lookup.

Record fields
Status

Whether a generation was published

Lease

Exact published generation when Status is Available

Withdraw

procedure Withdraw (Item : in out Publication)

Revoke Item's exact publication. This is idempotent and cannot revoke a later publication. Call it before releasing the service resources when performing an orderly stop; finalization supplies the failure path.

Parameters
Item

Publication to withdraw