Skip to content

Commit 5970b04

Browse files
committed
docs: merge signals.rst into internals.rst
1 parent e3dcce2 commit 5970b04

File tree

2 files changed

+50
-58
lines changed

2 files changed

+50
-58
lines changed

docs/internals.rst

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,53 @@ Helpers
273273
Signals
274274
=======
275275

276-
:ref:`Please refer to Signals <signals>`.
276+
Mitogen contains a simplistic signal mechanism to decouple its components. When
277+
a signal is fired by an instance of a class, functions registered to receive it
278+
are called back.
279+
280+
.. warning::
281+
282+
As signals execute on the Broker thread, and without exception handling,
283+
they are generally unsafe for consumption by user code, as any bugs could
284+
trigger crashes and hangs for which the broker is unable to forward logs,
285+
or ensure the buggy context always shuts down on disconnect.
286+
287+
288+
Functions
289+
---------
290+
291+
.. currentmodule:: mitogen.core
292+
293+
.. autofunction:: listen
294+
.. autofunction:: unlisten
295+
.. autofunction:: fire
296+
297+
298+
List
299+
----
300+
301+
These signals are used internally by Mitogen.
302+
303+
.. list-table::
304+
:header-rows: 1
305+
:widths: auto
306+
307+
* - Class
308+
- Name
309+
- Description
310+
311+
* - :py:class:`mitogen.core.Stream`
312+
- ``disconnect``
313+
- Fired on the Broker thread when disconnection is detected.
314+
315+
* - :py:class:`mitogen.core.Context`
316+
- ``disconnect``
317+
- Fired on the Broker thread during shutdown (???)
318+
319+
* - :py:class:`mitogen.core.Broker`
320+
- ``shutdown``
321+
- Fired after Broker.shutdown() is called.
322+
323+
* - :py:class:`mitogen.core.Broker`
324+
- ``exit``
325+
- Fired immediately prior to the broker thread exit.

docs/signals.rst

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)