This file is indexed.

/usr/share/doc/libjs-mathjax-doc/html/_sources/api/signal.rst.txt is in libjs-mathjax-doc 2.7+20171212-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.. _api-signal:

*********************************
The MathJax.Callback.Signal Class
*********************************

The ``MathJax.Callback.Signal`` object is one of the key mechanisms
used by MathJax to synchronize its actions with those that occur
asynchronously, like loading files and stylesheets.  A `Signal` object
is used to publicize the fact that MathJax has performed certain
actions, giving other code running the web page the chance to react to
those actions.  See :ref:`Synchronizing with MathJax
<synchronization>` for more details, and :ref:`Using Signals
<using-signals>` in particular for examples of how to specify and use
MathJax `Signal` objects.

The `Callback Signal` object is a subclass of the :ref:`Callback Queue
<api-queue>` object.


Properties
----------

.. describe:: name

    The name of the signal.  Each signal is named so that
    various components can access it.  The first one to request a
    particular signal causes it to be created, and other requests for
    the signal return references to the same object.

.. describe:: posted

    Array used internally to store the post history so that when new
    listeners express interests in this signal, they can be informed
    of the signals that have been posted so far.  This can be cleared
    using the signal's :meth:`Clear()` method.

.. describe:: listeners

    Array of callbacks to the listeners who have expressed interest in
    hearing about posts to this signal.  When a post occurs, the
    listeners are called, each in turn, passing them the message that
    was posted.


Methods
-------

.. method:: Post(message[,callback])

    Posts a message to all the listeners for the signal.  The listener
    callbacks are called in turn (with the message as an argument),
    and if any return a `Callback` object, the posting will be
    suspended until the callback is executed.  In this way, the
    :meth:`Post()` call can operate asynchronously, and so the
    `callback` parameter is used to synchronize with its operation;
    the `callback` will be called when all the listeners have responded
    to the post.
        
    If a :meth:`Post()` to this signal occurs while waiting for the
    response from a listener (either because a listener returned a
    `Callback` object and we are waiting for it to complete when the
    :meth:`Post()` occurred, or because the listener itself called the
    ``Post()`` method), the new message will be queued and will be
    posted after the current message has been sent to all the
    listeners, and they have all responded.  This is another way in
    which posting can be asynchronous; the only sure way to know that
    a posting has occurred is through its `callback`. When the posting
    is complete, the callback is called, passing it the signal object
    that has just completed.
        
    Returns the callback object (or a blank callback object if none
    was provided).

    :Parameters:
        - **message** --- the message to send through the signal
        - **callback** --- called after the message is posted
    :Returns: the callback or a blank callback

.. method:: Clear([callback])
    :noindex:

    This causes the history of past messages to be cleared so new
    listeners will not receive them.  Note that since the signal may
    be operating asynchronously, the :meth:`Clear()` may be queued for
    later.  In this way, the :meth:`Post()` and :meth:`Clear()`
    operations will be performed in the proper order even when they
    are delayed.  The `callback` is called when the :meth:`Clear()`
    operation is completed.
        
    Returns the callback (or a blank callback if none is provided).

    :Parameters:
	- **callback** --- called after the signal history is cleared
    :Returns: the callback or a blank callback

.. method:: Interest(callback[,ignorePast])

    This method registers a new listener on the signal.  It creates a
    `Callback` object from the callback specification, attaches it to
    the signal, and returns that `Callback` object.  When new messages
    are posted to the signal, it runs the callback, passing it the
    message that was posted.  If the callback itself returns a
    `Callback` object, that indicates that the listener has started an
    asynchronous operation and the poster should wait for that
    callback to complete before allowing new posts on the signal.

    If `ignorePast` is ``false`` or not present, then before
    :meth:`Interest()` returns, the callback will be called with all
    the past messages that have been sent to the signal.

    :Parameters:
	- **callback** --- called whenever a message is posted (past or present)
	- **ignorePast** --- ``true`` means ignore previous messages
    :Returns: the callback object
        
.. method:: NoInterest(callback)

    This removes a listener from the signal so that no new messages
    will be sent to it.  The callback should be the one returned by
    the original :meth:`Interest()` call that attached the listener to
    the signal in the first place.  Once removed, the listener will no
    longer receive messages from the signal.

    :Parameters:
	- **callback** --- the listener to be removed from signal
    :Returns: ``null``

.. method:: MessageHook(message, callback)

    This creates a callback that is called whenever the signal posts
    the given message.  This is a little easier than having to write a
    function that must check the message each time it is called.
    Although the `message` here is a string, if a message posted to the
    signal is an array, then only the first element of that array is
    used to match against the message.  That way, if a message contains an
    identifier plus arguments, the hook will match the identifier and
    still get called with the complete set of arguments.
        
    Returns the `Callback` object that was produced.

    :Parameters:
        - **message** --- the message to look for from the signal
	- **callback** --- called when the message is posted
    :Returns: the callback object

.. method:: ExecuteHook(message)

    Used internally to call the listeners when a particular
    message is posted to the signal.

    :Parameters:
        - **message** --- the posted message
    :Returns: ``null``