Change in vdsm[master]: virt: add run_async helper
mzamazal at redhat.com
mzamazal at redhat.com
Thu Dec 3 13:29:20 UTC 2015
Milan Zamazal has posted comments on this change.
Change subject: virt: add run_async helper
......................................................................
Patch Set 2:
(3 comments)
https://gerrit.ovirt.org/#/c/49570/2/vdsm/virt/utils.py
File vdsm/virt/utils.py:
Line 121:
Line 122:
Line 123: class AsyncStartError(Exception):
Line 124: """
Line 125: Impossible to start the execution of a callable.
... the asynchronous execution ...
Line 126: """
Line 127: def __init__(self, error):
Line 128: self.error = error
Line 129:
Line 131: def run_async(func, name=None, daemon=False, logger=None,
Line 132: semaphore=None, error='failed to start'):
Line 133: """
Line 134: Execute one callable, `func', in a background thread.
Line 135: If `name' is not None set, set thread name.
Better: If `name' is not None, set it as the thread name.
Line 136: If `daemon' is True, create a daemon thread.
Line 137: If `logger` is set, unhandled exceptions which occurs
Line 138: after the execution started will be logged on this logger;
Line 139: Otherwise the root logger will be used.
Line 141: sempahore before to start the `func' callable, and will
Line 142: release it once `func' exits.
Line 143: If `error' is not None, will use as return value to
Line 144: feed AsyncStartError.
Line 145: """
Please edit the whole docstring, there are several typos and grammar problems there, making it difficult to read.
Line 146: starting_error = [None]
Line 147: started = threading.Event()
Line 148:
Line 149: def _throttle():
--
To view, visit https://gerrit.ovirt.org/49570
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfb405389c465d2a8b8fc8b6f958926d58167a26
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list