RFC: Mitogen 0.4
Mostly a dumping ground for ideas, wishes, and discussion for now. None of these are even close to commitments or specifications
ansible_mitogen
ansible_mitogen->mitogen.ansible?ansible_mitogen.connection._connect_*()-> respective modulesansible.mitogen.connection.convert_bool()->ansible.module_utils.parsing.convert_bool.boolean()?- Remove
ansible_mitogensys.pathmanipulations - Remove
ansible_mitogen.loader.*__get, or include "unwrapped" in names - Remove
ansible_mitogen.loaderre-export of Ansible loader classes - Remove
ansible_mitogen.plugins.connection.{mitogen_doas,mitogen_sudo,mitogen_su}? - Clearly designate Mitogen specific methods (e.g.
Connection._mito_thing()) vs Ansible methods (e.g.StrategyBase._execute_meta())
mitogen
mitogen.Poller->mitogen.{SelectPoller,Selector,AbstractPoller}?mitogen.compatto unify backward compatibility workarounds- mitogen connections/transport modules to a namespace -> e.g.
mitogen.connection,mitogen.transports
Plumbing
- Type signatures?
- Remove releases branch?
- Publish as Ansible Galaxy collection?
- Switch to src/*.py?
- Replace/supplement
mitogen.service.argspec()decorator with Python type annotations? - Tighten up function signatures, e.g.
ansible_mitogen.services.ContextService.__init__() - Consolidate duplicated FORK_SUPPORTED flags
- move
ansible_mitogen.mixins.ActionModuleMixin->ansible_mitogen.plugins.action...? - Eliminiate uses of
unicode_literals
- Change default remote python_path from
python->python3 - Add python_path search, ala Ansible interpreter discovery?
- Remove argument formatting from
mitogen.core.Erroret al? Aim: consistency with Exception API.
Remove/fix use of poller_class arg in mitogen.core.Router #1064
➜ mitogen git:(issue1185-blockingioerror) ✗ ag -C3 deprecated:: mitogen ansible_mitogen
mitogen/core.py
1210- """
1211- Return `size() == 0`.
1212-
1213: .. deprecated:: 0.2.8
1214- Use :meth:`size` instead.
1215-
1216- :raises LatchError:
--
1263- A channel inherits from :class:`mitogen.core.Sender` and
1264- `mitogen.core.Receiver` to provide bidirectional functionality.
1265-
1266: .. deprecated:: 0.2.0
1267- This class is incomplete and obsolete, it will be removed in Mitogen
1268- 0.3.
1269-
--
2794- """
2795- Return `size() == 0`.
2796-
2797: .. deprecated:: 0.2.8
2798- Use :meth:`size` instead.
2799-
2800- :raises LatchError:
mitogen/select.py
285- """
286- Return `size() == 0`.
287-
288: .. deprecated:: 0.2.8
289- Use :meth:`size` instead.
290- """
291- return self._latch.empty()
- Rename/reorgnize modules, e.g.
- Underscore prefix internal modules, would eliminate name clash of stdlib
selectandmitogen.selectwhenabsolute_importisn't in effect. - Decouple helper functions from whterh they're needed by parent, master, etc
- Consider platform specfic modules ala
os.pathcomposed at import time fromposixpath,ntpathetc.
- Underscore prefix internal modules, would eliminate name clash of stdlib
mitogen.core.TimeoutError - name clashes/may cause be confused with Python builtin TimeoutError
Remove PY24 and PY3 constants - style checkers don't treat them as static, just use sys.version_info directly
Move mitogen.main() decoreator?
So the imports inside it don't cause upgraded mitogen.master.scan_code_imports() and mitogen.master.ModuleFinder.find_related() to pull in mitogen.master for any module in mitogen. refs #1287 #682 #733
Idea: A CLI interface e.g. python -m mitogen -t ssh [email protected] -c "import sys; print(sys.version_info)"
Consider https://github.com/mitogen-hq/mitogen/issues/1218 (Ansible min/max version check)
Rename Mitogen signals to notifications. Avoids name clashes with POSIX signals.
logging config inspiration https://pkg.go.dev/github.com/daotl/go-log/v2#readme-environment-variables
Remove legacy macOS/OSX workarounds in first stage?