For example, if the above service.root.raster function were to print
something or do some server side computation, you wouldn't see
anything happening on the server until a call was made to res.ready.
Any ideas why this is happening?
On Nov 11 2009, 6:14 am, tomer filiba <tomerfil...@gmail.com> wrote:
> that's because you're using it wrong:
> async_function_obj = rpyc.async(service.root.raster('%s/data/%s' %
> (work_dir, city), 0, 9, done_callback, status_callback))
>
> what you've done here is not async -- it's sync. you invoke the function
> synchronously and then wrap the result with an async wrapper.
>
> here's what you should be doing:
>
> async_func = rpyc.async(service.root.raster)
> res = async_func('%s/data/%s' % (work_dir, city), 0, 9)
>
> now you have an AsyncResult object, which you can use to poll the progress
> of the async operation:
> res.ready - whether the result has arrived or not
> res.wait() - wait for the result to arrive
> res.value - the value of the result (will block until the result arrives)
> etc.
>
> An NCO and a Gentleman
>