docs: a few more internals.rst additions

new-serialization
David Wilson 5 years ago
parent db37000dd5
commit e0d9b8d1e1

@ -65,6 +65,10 @@ Stream, Side & Protocol
.. autoclass:: Stream .. autoclass:: Stream
:members: :members:
.. currentmodule:: mitogen.core
.. autoclass:: BufferedWriter
:members:
.. currentmodule:: mitogen.core .. currentmodule:: mitogen.core
.. autoclass:: Side .. autoclass:: Side
:members: :members:
@ -81,6 +85,10 @@ Stream, Side & Protocol
.. autoclass:: DelimitedProtocol .. autoclass:: DelimitedProtocol
:members: :members:
.. currentmodule:: mitogen.parent
.. autoclass:: LogProtocol
:members:
.. currentmodule:: mitogen.core .. currentmodule:: mitogen.core
.. autoclass:: IoLoggerProtocol .. autoclass:: IoLoggerProtocol
:members: :members:

@ -2727,9 +2727,9 @@ class Latch(object):
class Waker(Protocol): class Waker(Protocol):
""" """
:class:`BasicStream` subclass implementing the `UNIX self-pipe trick`_. :class:`Protocol` implementing the `UNIX self-pipe trick`_. Used to wake
Used to wake the multiplexer when another thread needs to modify its state :class:`Broker` when another thread needs to modify its state, by enqueing
(via a cross-thread function call). a function call to run on the :class:`Broker` thread.
.. _UNIX self-pipe trick: https://cr.yp.to/docs/selfpipe.html .. _UNIX self-pipe trick: https://cr.yp.to/docs/selfpipe.html
""" """

@ -1250,6 +1250,9 @@ class LogProtocol(LineLoggingProtocolMixin, mitogen.core.DelimitedProtocol):
written to it. written to it.
""" """
def on_line_received(self, line): def on_line_received(self, line):
"""
Read a line, decode it as UTF-8, and log it.
"""
super(LogProtocol, self).on_line_received(line) super(LogProtocol, self).on_line_received(line)
LOG.info(u'%s: %s', self.stream.name, line.decode('utf-8', 'replace')) LOG.info(u'%s: %s', self.stream.name, line.decode('utf-8', 'replace'))

Loading…
Cancel
Save