This is an automatically generated e-mail. To reply, visit: http://reviewboard-fedoraserver.rhcloud.com/r/62/ |
src/rolekit/async.py (Diff revision 1) | |||
---|---|---|---|
def do_something_async(param): |
|||
67 | __all__ = ("start_async_with_callbacks", "async_call") |
70 | __all__ = ("start_async_with_callbacks", |
71 | "async_call", |
||
72 | "async_subprocess") |
My OCD would like these to be alphabetically-sorted… (and I know I broke that first, sorry).
src/rolekit/async.py (Diff revision 1) | |||
---|---|---|---|
173 | raise RolekitError(COMMAND_FAILED, "%d" % p.returncode) |
Does this actually work?
From my reading of Future (but not testing this!), the callback is run somewhere within the worker thread (inside future.set_result() -> future._invoke_callbacks()), and an exception is logged and ignored.
src/rolekit/async.py (Diff revision 1) | |||
---|---|---|---|
178 | log.error("Subprocess exception: %r", e) |
||
179 | raise e |
Same here.
AFAICT this would be simplest with a helper function that does p.communicate + the handling in finish_subprocess, and submitting that helper function to the executor; then the helper can simply return or raise exceptions.
And async_subprocess could return the future returned by executor.submit directly to the caller.
- Miloslav Trmac
On srpen 1st, 2014, 9:02 odp. CEST, Stephen Gallagher wrote:
Review request for RoleKit Mailing List, Miloslav Trmac, Stephen Gallagher, and Thomas Woerner.
By Stephen Gallagher.
Updated Srp. 1, 2014, 9:02 odp.
Repository:
rolekit
Description
Testing
Diffs
|