MCPcopy Index your code
hub / github.com/StackStorm/st2 / monkey_patch

Function monkey_patch

st2common/st2common/util/monkey_patch.py:36–56  ·  view source on GitHub ↗

Function which performs eventlet monkey patching and also takes into account "--use-debugger" argument in the command line arguments. If this argument is found, no monkey patching is performed for the thread module. This allows user to use remote debuggers. :param patch_thread

(patch_thread=None)

Source from the content-addressed store, hash-verified

34
35
36def monkey_patch(patch_thread=None):
37 """
38 Function which performs eventlet monkey patching and also takes into account "--use-debugger"
39 argument in the command line arguments.
40
41 If this argument is found, no monkey patching is performed for the thread module. This allows
42 user to use remote debuggers.
43
44 :param patch_thread: True to also patch the thread module. If not provided, thread module is
45 patched unless debugger is used.
46 :type patch_thread: ``bool``
47 """
48 import eventlet
49
50 if patch_thread is None:
51 patch_thread = not is_use_debugger_flag_provided()
52
53 # TODO: support gevent.patch_all if .concurrency.CONCURRENCY_LIBRARY = "gevent"
54 eventlet.monkey_patch(
55 os=True, select=True, socket=True, thread=patch_thread, time=True
56 )
57
58
59def use_select_poll_workaround(nose_only=True):

Callers 15

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
base.pyFile · 0.90
base.pyFile · 0.90
sensor_wrapper.pyFile · 0.90
sensormanager.pyFile · 0.90
rulesengine.pyFile · 0.90
timersengine.pyFile · 0.90

Calls 1

Tested by

no test coverage detected