Public | [types] [subprograms] |
type Overflow_Handler is interface; type Overflow_Handler_Access is access all Overflow_Handler'Class;
Callback interface type for reporting publication overflow conditions.
type Overflow_Action is (WAIT_FOR_PREVIOUS_MESSAGE, ABANDON_MESSAGE, ABANDON_SUBSCRIPTION);
User action for the overflow condition.
type Value_Publisher (<>) is limited new Incoming_Messages.Message_Handler with private;
The subscription publisher that notifies remote listeners with published value updates.
Remote listeners can subscribe and unsubscribe at any time.
The publisher is not registered at any agent after its creation.
Note: The "subscribe" and "unsubscribe" messages are also forwarded to the Command_Handler, but these two messages are already processed by the publisher's implementation.
procedure Overflow (H : in out Overflow_Handler; Server_Name: in String; Object_Name : in String; Value : YAMI.Serializables.Serializable'Class; Reaction : out Overflow_Action) is abstract;
User-defined reaction to the publication overflow condition.
function Make_Value_Publisher (Command_Handler : Incoming_Messages.Message_Handler_Access := null; Max_Queue_Length : Positive := 1; Overflow_Handler : Overflow_Handler_Access := null) return Value_Publisher;
Constructor function for value publisher objects.
procedure Subscribe (P : in out Value_Publisher; Destination_Target : in String; Destination_Object : in String);
Subscribes the new listener.
This function is usually called internally as a result of processing the remote "subscribe" message, but can be also used locally if the listener's location is obtained via other means.
procedure Unsubscribe (P : in out Value_Publisher; Destination_Target : in String);
Unsubscribes the given listener.
procedure Publish (P : in out Value_Publisher; Value : in Serializables.Serializable'Class; Priority : in Natural := 0);
Publishes the new value.
Sends the update message to all active listeners with the given value. In case of any errors or communication problems, the problematic listener is automatically unsubscribed.
procedure Number_Of_Subscribers (P : in out Value_Publisher; Num : out Natural);
Returns the number of active subscribers.
procedure Iterate_Subscribers_Info (P : in out Value_Publisher; Process : not null access procedure (Destination_Target : in String; Destination_Object : in String));
Inspects the information about all active subscribers.
Note: The iteration is performed in the mutually exclusive context so no operations affecting the same value publisher should be attempted from within the Process procedure.
procedure Register_At (P : in out Value_Publisher; The_Agent : Agents.Agent_Access; Object_Name : in String);
procedure Unregister (P : in out Value_Publisher);