Skip to content

Latest commit

 

History

History
78 lines (54 loc) · 2.06 KB

after_3.rst

File metadata and controls

78 lines (54 loc) · 2.06 KB
.. rst-class:: align-right

built-in method

.. index:: pair: after/3; Built-in method

after/3

Description

after(Object, Message, Sender)

User-defined method for handling :ref:`after events <events_definitions>`. This method is declared in the :ref:`monitoring <apis:monitoring/0>` built-in protocol as a public predicate and automatically called by the runtime for messages sent using the :ref:`control_send_to_object_2` control construct from within objects compiled with the :ref:`events <flag_events>` flag set to allow.

Note that you can make this predicate scope protected or private by using, respectively, :ref:`protected or private implementation <inheritance_scope>` of the monitoring protocol.

Modes and number of proofs

after(?object_identifier, ?callable, ?object_identifier) - zero_or_more

Errors

(none)

Examples

:- object(...,
    implements(monitoring),
    ...).

    % write a log message when a message is successful:
    after(Object, Message, Sender) :-
        writeq(Object), write('::'), writeq(Message),
        write(' from '), writeq(Sender), nl.
.. seealso::

   :ref:`methods_before_3`,
   :ref:`predicates_abolish_events_5`,
   :ref:`predicates_current_event_5`,
   :ref:`predicates_define_events_5`