diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-01-23 15:58:48 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-01-23 15:58:48 -0500 |
commit | 19e4d1ba808cbbe95568271a5b0075b8422e4fb6 (patch) | |
tree | 197d55cf717319c5ffe565f9aa8a639b962fc490 /func/overlord/client.py | |
parent | ce0eaca23fb42f77f67408e509bbe091f4c27e56 (diff) | |
download | func-19e4d1ba808cbbe95568271a5b0075b8422e4fb6.tar.gz func-19e4d1ba808cbbe95568271a5b0075b8422e4fb6.tar.xz func-19e4d1ba808cbbe95568271a5b0075b8422e4fb6.zip |
Double-barrel asynchronous calls. Async can now occur on both sides simultaneously and still appears as if there is only one
"global" job id to the API caller, the minion job id's are managed in the background, complete with partial result response
as things come in which should be very nice for ajaxy implication. job_status API does still need to be modified to list
active jobs as well as to store the job name.
Diffstat (limited to 'func/overlord/client.py')
-rwxr-xr-x | func/overlord/client.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py index 98edaed..6e663ea 100755 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -166,7 +166,7 @@ class Client(object): """ Use this to acquire status from jobs when using run with async client handles """ - return jobthing.job_status(jobid) + return jobthing.job_status(jobid, client_class=Client) # ----------------------------------------------- @@ -200,7 +200,16 @@ class Client(object): # we can't call "call" on s, since thats a rpc, so # we call gettatr around it. meth = "%s.%s" % (module, method) + + # async calling signature has an "imaginary" prefix + # so async.abc.def does abc.def as a background task. + # see Wiki docs for details + if self.async: + meth = "async.%s" % meth + + # this is the point at which we make the remote call. retval = getattr(conn, meth)(*args[:]) + if self.interactive: print retval except Exception, e: |