commit:     f0a96005d3da49fa52624d7c3e4b9d1d12b831ad
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 18 23:51:12 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 18 23:52:45 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0a96005

SubProcess._async_waitpid: document override usage

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/SubProcess.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/_emerge/SubProcess.py b/lib/_emerge/SubProcess.py
index e834cb7d3..f7353926c 100644
--- a/lib/_emerge/SubProcess.py
+++ b/lib/_emerge/SubProcess.py
@@ -48,9 +48,12 @@ class SubProcess(AbstractPollTask):
        def _async_waitpid(self):
                """
                Wait for exit status of self.pid asynchronously, and then
-               set the returncode and notify exit listeners. This is
-               prefered over _waitpid_loop, since the synchronous nature
-               of _waitpid_loop can cause event loop recursion.
+               set the returncode, and finally notify exit listeners via the
+               _async_wait method. Subclasses may override this method in order
+               to implement an alternative means to retrieve pid exit status,
+               or as a means to delay action until some pending task(s) have
+               completed (such as reading data that the subprocess is supposed
+               to have written to a pipe).
                """
                if self.returncode is not None:
                        self._async_wait()

Reply via email to