mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 22:13:00 +00:00
docstring review
This commit is contained in:
@@ -350,20 +350,26 @@ class Spawner(LoggingConfigurable):
|
|||||||
def poll(self):
|
def poll(self):
|
||||||
"""Check if the single-user process is running
|
"""Check if the single-user process is running
|
||||||
|
|
||||||
return None if it is, an exit status (0 if unknown) if it is not.
|
returns:
|
||||||
If the Spawner has not been initialized (neither loaded state, nor called start),
|
|
||||||
|
None, if single-user process is running.
|
||||||
|
Exit status (0 if unknown), if it is not running.
|
||||||
|
|
||||||
|
State transitions, behavior, and return response:
|
||||||
|
|
||||||
|
- If the Spawner has not been initialized (neither loaded state, nor called start),
|
||||||
it should behave as if it is not running (status=0).
|
it should behave as if it is not running (status=0).
|
||||||
If the Spawner has not finished starting,
|
- If the Spawner has not finished starting,
|
||||||
it should behave as if it is running (status=None).
|
it should behave as if it is running (status=None).
|
||||||
|
|
||||||
Assumptions about poll and when it can be called:
|
Design assumptions about when `poll` may be called:
|
||||||
|
|
||||||
- poll may be called before start when state is loaded on Hub restart.
|
- On Hub launch: `poll` may be called before `start` when state is loaded on Hub launch.
|
||||||
It should return 0 if the Spawner has not been initialized
|
`poll` should return exit status 0 (unknown) if the Spawner has not been initialized via
|
||||||
via either load_state or start.
|
`load_state` or `start`.
|
||||||
- If `.start()` is async, poll may be called during any yielded
|
- If `.start()` is async: `poll` may be called during any yielded portions of the `start`
|
||||||
portions of start. It should return None in this condition,
|
process. `poll` should return None when `start` is yielded, indicating that the `start`
|
||||||
indicating that the process has not yet exited.
|
process has not yet completed.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError("Override in subclass. Must be a Tornado gen.coroutine.")
|
raise NotImplementedError("Override in subclass. Must be a Tornado gen.coroutine.")
|
||||||
|
Reference in New Issue
Block a user