diff --git a/docs/api.rst b/docs/api.rst index 37640464..17b1b38d 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -917,6 +917,11 @@ Context Class :param bool wait: If :py:data:`True`, block the calling thread until the context has completely terminated. + :returns: + If `wait` is :data:`False`, returns a :class:`mitogen.core.Latch` + whose :meth:`get() ` method returns + :data:`None` when shutdown completes. The `timeout` parameter may + be used to implement graceful timeouts. .. method:: call_async (fn, \*args, \*\*kwargs) diff --git a/mitogen/parent.py b/mitogen/parent.py index 497ccd0a..2203ef9c 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -806,7 +806,8 @@ class Context(mitogen.core.Context): if wait: latch.get() - return latch + else: + return latch class RouteMonitor(object):