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
:members:
.. currentmodule:: mitogen.core
.. autoclass:: BufferedWriter
:members:
.. currentmodule:: mitogen.core
.. autoclass:: Side
:members:
@ -81,6 +85,10 @@ Stream, Side & Protocol
.. autoclass:: DelimitedProtocol
:members:
.. currentmodule:: mitogen.parent
.. autoclass:: LogProtocol
:members:
.. currentmodule:: mitogen.core
.. autoclass:: IoLoggerProtocol
:members:

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

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

Loading…
Cancel
Save