Change in vdsm[master]: utils: Create AsyncProcessOperation

smizrahi at redhat.com smizrahi at redhat.com
Tue Oct 8 11:40:47 UTC 2013


Saggi Mizrahi has posted comments on this change.

Change subject: utils: Create AsyncProcessOperation
......................................................................


Patch Set 9:

(1 comment)

....................................................
File lib/vdsm/utils.py
Line 914: 
Line 915:             time.sleep(sleep)
Line 916: 
Line 917: 
Line 918: class AsyncProcessOperation(object):
This is supposed to Wrap AsyncProc abstracting the fact that it's a process giving the appearance of a Future[1] object.

AsyncProc is a low level implementation for accessing a subprocess' streams asynchronously.

For example, A wrapper around DD will use AsyncProc and give a different interface (add ability to inspect progress information, not have result()).

You should return an AsyncProcessOperation instead of an AsyncProc when you want to hide the fact that you are using a sub-process to the user[2].

- [1] https://en.wikipedia.org/wiki/Call_by_future#Call_by_future
- [2] https://en.wikipedia.org/wiki/Abstraction_layer
Line 919:     def __init__(self, proc, resultParser=None):
Line 920:         """Wraps a running process operation.
Line 921: 
Line 922:         resultParser should be of type callback(rc, out, err) and can return


-- 
To view, visit http://gerrit.ovirt.org/19254
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I79d0eefc9d917a4a93916d52867fb4f1e793c60e
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Barak Azulay <bazulay at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list