.net-remoting

Execute Python function in Main thread from call in Dummy thread

ε祈祈猫儿з 提交于 2019-11-27 14:01:20
I have a Python script that handles aynchronous callbacks from .NET Remoting. These callbacks execute in a dummy (worker) thread. From inside my callback handler, I need to call a function I've defined in my script, but I need the function to execute in the main thread. The Main thread is a remote client that sends commands to a server. Some of these commands result in asynchronous callbacks. Basically, I need the equivalent of .NET's Invoke method. Is this possible? You want to use the Queue class to set up a queue that your dummy threads populate with functions and that your main thread

Execute Python function in Main thread from call in Dummy thread

时光毁灭记忆、已成空白 提交于 2019-11-26 16:34:21
问题 I have a Python script that handles aynchronous callbacks from .NET Remoting. These callbacks execute in a dummy (worker) thread. From inside my callback handler, I need to call a function I've defined in my script, but I need the function to execute in the main thread. The Main thread is a remote client that sends commands to a server. Some of these commands result in asynchronous callbacks. Basically, I need the equivalent of .NET's Invoke method. Is this possible? 回答1: You want to use the