Commit Graph

29 Commits

Author SHA1 Message Date
David Wilson 3f5774cfd5 core: document/tidy up poller.
Remove duplicate attribute creates in subclasses too.
2018-12-19 20:23:00 +00:00
David Wilson 804bacdadb docs: move most remaining docstrings back into *.py; closes #388
The remaining ones are decorators which don't seem to have an autodoc
equivlent.
2018-11-02 15:14:00 +00:00
David Wilson 0d410aef51 docs: fix internals.rst headings. 2018-10-31 15:08:27 +00:00
David Wilson 0394dac2c7 docs: document RouteMonitor class. 2018-10-31 15:06:47 +00:00
David Wilson 27b64a484b docs: document mitogen.core.CHUNK_SIZE. 2018-08-18 16:44:00 +01:00
David Wilson ec8d759d46 docs: document one more. 2018-08-18 16:44:00 +01:00
David Wilson 442d88e3d7 docs: many more fixes/merges. 2018-08-18 16:44:00 +01:00
David Wilson a561fb79e5 docs: merge more docs back into mitogen/core.py. 2018-08-18 16:43:59 +01:00
David Wilson 0461738ca6 docs: small reference fixes. 2018-07-08 22:00:00 +01:00
David Wilson e24eddb1ce core: move Latch docs back inline. 2018-07-07 14:55:47 +01:00
David Wilson bc7be1879d issue #249: initial poller implementation (BSD only) 2018-05-14 18:31:38 +01:00
David Wilson 43e9e51ed6 docs: link signals into internals.rst. 2018-05-04 03:47:29 +01:00
David Wilson 4c5e13bf87 core: add Stream.pending_bytes() accessor. 2018-04-22 02:17:09 +01:00
David Wilson 7c88e4d013 Move _DEAD into header, autogenerate dead messages
This change blocks off 2 common scenarios where a race condition is
upgraded to a hang, when the library could internally do better.

* Since we don't know whether the receiver of a `reply_to` is expecting
  a raw or pickled message, and since in the case of a raw reply, there
  is no way to signal "dead" to the receiver, override the reply_to
  field to explicitly mark a message as dead using a special handle.

  This replaces the serialized _DEAD sentinel value with a slightly
  neater interface, in the form of the reserved IS_DEAD handle, and
  enables an important subsequent change: when a context cannot route a
  message, it can send a generic 'dead' reply back towards the message
  source, ensuring any sleeping thread is woken with ChannelError.

  The use of this field could potentially be extended later on if
  additional flags are needed, but for now this seems to suffice.

* Teach Router._invoke() to reply with a dead message when it receives a
  message for an invalid local handle.

* Teach Router._async_route() to reply with a dead message when it
  receives an unroutable message.
2018-04-22 00:17:27 +01:00
David Wilson e43c6c531b Mostly implement hybrid TTY/socket mode for sudo and SSH.
Presently there is still no mechanism to add :attr:`tty_stream` to the
multiplexer after connection is successful, but for now it's not
expected that anything will be logged to it anyway.

Closes #148.
2018-04-18 21:40:24 +01:00
David Wilson 8676c40674 core: make _start_transmit / _stop_transmit async-only
For now at least, these APIs are always used in an asynchronous context,
so stop using the defer mechanism.
2018-03-29 15:10:43 +05:45
David Wilson 110fdf24cd docs: add mitogen.fork.Stream to internals.rst 2018-03-24 15:53:06 +05:45
David Wilson 8aada2646c core: support throwing LatchError in every sleeping thread
This is to allow Select() to be used as a generic queueing primitive
that supports graceful shutdown.
2018-03-19 21:58:35 +05:45
David Wilson 03e51fdaa7 docs: mitogen.core.Latch docs 2018-03-19 21:58:32 +05:45
David Wilson 4d940f08ae importer: drop redundant prefix from pkg_present
For the 52 submodules of ansible.modules.system, this produced a 1602
byte pkg_present list. After stripping it becomes 406 bytes, and the
entire LOAD_MODULE size drops from 1988 bytes to 792 bytes (-60%).

For the 68 submodules of ansible.module_utils, 1902 bytes pkg_present
becomes 474 bytes (-75%), and LOAD_MODULE size drops from 2867 bytes to
1439 bytes (-49%).

In a simple test running Ansible's "setup" module followed by its "apt"
module, wire bytes sent drops from 140,357 to 135,531 (-3.4%).
2018-03-19 21:58:29 +05:45
David Wilson 07d4d799f1 Add mitogen.main() decorator mainly for docs and demo use. 2018-03-19 21:58:28 +05:45
David Wilson 984b39180e importer: Beginnings of howitworks section. 2018-03-19 21:58:28 +05:45
David Wilson 9372d2c3de docs: Fix up tons of references, document trust chain 2018-03-19 21:35:38 +05:45
David Wilson ec66152e37 docs: better io_op doc, move Side docs to Sphinx. 2018-03-19 21:35:37 +05:45
David Wilson 0767abf26f docs: move BasicStream docs into Sphinx. 2018-03-19 21:35:37 +05:45
David Wilson 416ab90e02 docs: Fix index generation everywhere. 2018-03-19 21:35:37 +05:45
David Wilson 04ea5306e9 Document a bunch of mitogen.master and move more docstrings into Sphinx. 2018-03-19 21:35:35 +05:45
David Wilson b809d43865 Move more docstrings out of core.py. 2018-03-19 21:35:35 +05:45
David Wilson e7ff6259a3 Initial commit. 2018-03-19 21:35:13 +05:45