MCPcopy
hub / github.com/tornadoweb/tornado / add_reload_hook

Function add_reload_hook

tornado/autoreload.py:152–159  ·  view source on GitHub ↗

Add a function to be called before reloading the process. Note that for open file and socket handles it is generally preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or `os.set_inheritable`) instead of using a reload hook to close them.

(fn: Callable[[], None])

Source from the content-addressed store, hash-verified

150
151
152def add_reload_hook(fn: Callable[[], None]) -> None:
153 """Add a function to be called before reloading the process.
154
155 Note that for open file and socket handles it is generally
156 preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or
157 `os.set_inheritable`) instead of using a reload hook to close them.
158 """
159 _reload_hooks.append(fn)
160
161
162def _reload_on_update(modify_times: Dict[str, float]) -> None:

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected