Tomer,

On 25 November 2011 11:28, Ringo De Smet <[email protected]> wrote:

>
> I was able to reproduce it. Once I added a client side object as one of
> the arguments to the remote invocation, the behaviour changes and the
> server side only invokes at the time the AsyncResult.wait() is invoked. I
> created two gists, one with just a remote invocation and correct async
> behaviour, the other passing a client side object resulting in the
> incorrect behaviour.
>
> correct: https://gist.github.com/1393209
> incorrect: https://gist.github.com/1393212
>
> I haven't created an issue yet as it might be possible there is something
> I misunderstood from rpyc. So please correct me first if needed on my use
> of rpyc.
>

I have been delving in the rpyc code, and I found the reason of the
different behavior. Below is also a client program that supports my
assumption.

Once you do an async request from the client side to the server, any
callback from the server to the client is not processed as there is no
Python thread processing requests on any rpyc socket. Once you have a
thread calling into rpyc again, any data waiting on a socket is processed
and the callback served. I have updated my client application to do a
synchronous but on a separate thread. Any callback, in my case already the
HANDLE_INSPECT on the object I pass, is not served on the client due to the
async nature. When doing a sync call, it works correctly.

Here is my adapted client program:
https://gist.github.com/1399763

Except for a changed log formatting, the server program was unmodified (see
previous gists)

I can live with the fact that you do not change rpyc to support this
behaviour, but please do document that async and callbacks don't work
together!!

Ringo

Reply via email to