hey

i'm sorry, i won't have time to look into the details until the weekend,
but from what you describe -- it seems you just need to use the
BgServingThread.
see:
* http://rpyc.sourceforge.net/tutorial/tut5.html#tut5
*
http://rpyc.sourceforge.net/api/utils_classic.html#rpyc.utils.helpers.BgServingThread

again, perhaps you found some other bug, but i'll look into it later.

thanks for the investigation and effort
-tomer


-----------------------------------------------------------------

*Tomer Filiba*
tomerfiliba.com     <http://www.facebook.com/tomerfiliba>
<http://il.linkedin.com/in/tomerfiliba>



On Mon, Nov 28, 2011 at 11:35, Ringo De Smet <[email protected]> wrote:

> 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