Ampoule

Latest version: v24.10.0

Safety actively analyzes 682244 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 2

0.0.5

==========================

Changes
--------
- Fixed bug 259264, this fix introduces a number of changes in the
architecture of the project:
1. Removed childReactor argument form the process pool and added
a starter argument.
2. Introduced the concept of a starter object whose role is to
start subprocesses with given parameters. This makes it easier
to specify particular parameters (eg. new env variables) to the
child processes without needing to override many methods in the
pool using closures.
3. main.py is completely changed and now provides the ProcessStarter
object which is a default implementation of IStarter.
4. IStarter interface currently documents only 2 methods:
startAMPProcess
startPythonProcess
in the future it's possible that we will add an additional:
startProcess
that starts whichever process we want without requiring python,
also this might end up with the separation of ProcessPool in at
least 2 logical levels: the ProcessPool and a dispatcher that
talks with the children, in this way it would be possible to
create custom ProcessPools without changing much code or requiring
any special requirement on the children.

- Introduced a callRemote method on the ProcessPool that is basically
the same as doWork. Introduced for symmetry between all the RPC libraries
in Twisted.

- reactor short name and ampoule child class are now passed as the 2
last arguments rather than the first 2. So if you have written any
custom bootstrap code be sure to change sys.argv[1] and sys.argv[2]
into sys.argv[-2] and sys.argv[-1] respectively.

0.0.4

==========================

Changes
--------
- Ampoule parent process and child processes now talk using FDs 3 (in)
and 4 (out) in order to avoid problems with libraries that mistakenly
send error lines to stdout (yes, I'm looking at you gtk+)

0.0.3

==========================

Features
--------
- Added a Twisted Matrix plugin to run a process pool service that
can be used over the network using an AMP client.

- Added ability to change the reactor used to run the children

Changes
-------
- If you wrote your own bootstrap code for the pool you should change
the way it works because now it takes 2 arguments, sys.argv[1] is
the reactor short name while sys.argv[2] is still the AMPChild path.
If you don't use startAMPProcess you probably have nothing to worry
about.

Fixes
-----
- Now the process pool doesn't raise an error when you use a command
that doesn't require an answer.

0.0.2

==========================

Features
--------
- Support process recycling after predefined number of calls.

Changes
-------
- ProcessPool argument max_idle is now maxIdle to comply with Twisted
style guidelines.

- ProcessPool.startAWorker is now a synchronous call

- removed ampoule.runner module because it was essentially useless,
if you want to change subprocess startup behavior pass it as an
argument by overriding the processFactory with a closure like this:

from ampoule.main import startAMPProcess
from ampoule.pool import ProcessPool
pp = ProcessPool()
def myProcessFactory(*args, **kwargs):
kwargs['bootstrap'] = myBootstrapCode
return startAMPProcess(*args, **kwargs)
pp.processFactory = staticmethod(myProcessFactory)

Page 2 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.