MCPcopy Create free account
hub / github.com/EasyIME/PIME / initialize

Method initialize

python/python3/tornado/process.py:309–330  ·  view source on GitHub ↗

Initializes the ``SIGCHLD`` handler. The signal handler is run on an `.IOLoop` to avoid locking issues. Note that the `.IOLoop` used for signal handling need not be the same one used by individual Subprocess objects (as long as the ``IOLoops`` are each running in sep

(cls)

Source from the content-addressed store, hash-verified

307
308 @classmethod
309 def initialize(cls) -> None:
310 """Initializes the ``SIGCHLD`` handler.
311
312 The signal handler is run on an `.IOLoop` to avoid locking issues.
313 Note that the `.IOLoop` used for signal handling need not be the
314 same one used by individual Subprocess objects (as long as the
315 ``IOLoops`` are each running in separate threads).
316
317 .. versionchanged:: 5.0
318 The ``io_loop`` argument (deprecated since version 4.1) has been
319 removed.
320
321 Availability: Unix
322 """
323 if cls._initialized:
324 return
325 io_loop = ioloop.IOLoop.current()
326 cls._old_sigchld = signal.signal(
327 signal.SIGCHLD,
328 lambda sig, frame: io_loop.add_callback_from_signal(cls._cleanup),
329 )
330 cls._initialized = True
331
332 @classmethod
333 def uninitialize(cls) -> None:

Callers 1

set_exit_callbackMethod · 0.45

Calls 2

currentMethod · 0.80

Tested by

no test coverage detected