2010-08-25, 15:44
Well,
In the process of trying to figure this out, I'm a bit confused by the codebase and was hoping someone might be able to answer a question or three.
It appears that "MakePendingCalls" (which delivers the callback invocation to the Python code) is only issued from a "xbmx.Sleep" or a Window.DoModal() call. I cannot follow how callbacks generally make it into the Python side other than having a Sleep or DoModal issued from the python code. I find this odd and think I'm missing something.
I find this strange because it appears that the calls are made asynchronously from the C side but can only be received when one of these two calls are made from the Python side.
I guess my questions are:
1) Is this a correct understanding?
2) If so, is this the desired behavior? If not, I can think about how to make this work in a (more) truly asynchronous manner (I understand the Python limitations on multi-threaded code and what needs to be done to handle the InterpreterState and ThreadState).
3) Is there a desire to implement synchronous callbacks from the C side? That is, the call issued from the C side wont return until the Python addon has handled it and responded. If so, I can think about how to make that work - even given the Python multithreading limitations.
Thanks
Jim
In the process of trying to figure this out, I'm a bit confused by the codebase and was hoping someone might be able to answer a question or three.
It appears that "MakePendingCalls" (which delivers the callback invocation to the Python code) is only issued from a "xbmx.Sleep" or a Window.DoModal() call. I cannot follow how callbacks generally make it into the Python side other than having a Sleep or DoModal issued from the python code. I find this odd and think I'm missing something.
I find this strange because it appears that the calls are made asynchronously from the C side but can only be received when one of these two calls are made from the Python side.
I guess my questions are:
1) Is this a correct understanding?
2) If so, is this the desired behavior? If not, I can think about how to make this work in a (more) truly asynchronous manner (I understand the Python limitations on multi-threaded code and what needs to be done to handle the InterpreterState and ThreadState).
3) Is there a desire to implement synchronous callbacks from the C side? That is, the call issued from the C side wont return until the Python addon has handled it and responded. If so, I can think about how to make that work - even given the Python multithreading limitations.
Thanks
Jim