maybe_patch_concurrency
Apply eventlet/gevent monkeypatches.
With short and long opt alternatives that specify the command line option to set the pool, this makes sure that anything that needs to be patched is completed as early as possible. (e.g., eventlet/gevent monkey patches).
def maybe_patch_concurrency(
argv: list = sys.argv,
short_opts: list = ['-P'],
long_opts: list = ['--pool'],
patches: dict = {'eventlet': _patch_eventlet, 'gevent': _patch_gevent}
) - > null
Apply eventlet/gevent monkeypatches. With short and long opt alternatives that specify the command line option to set the pool, this makes sure that anything that needs to be patched is completed as early as possible. (e.g., eventlet/gevent monkey patches).
Parameters
| Name | Type | Description |
|---|---|---|
| argv | list = sys.argv | The list of command-line arguments to parse for pool selection. |
| short_opts | list = ['-P'] | A list of short-form command-line flags used to identify the concurrency pool. |
| long_opts | list = ['--pool'] | A list of long-form command-line flags used to identify the concurrency pool. |
| patches | dict = {'eventlet': _patch_eventlet, 'gevent': _patch_gevent} | A mapping of pool names to their respective patching functions. |
Returns
| Type | Description |
|---|---|
null | Nothing is returned; the function performs side-effect monkeypatching and environment setup. |