Archived Forum Post

Index of archived forum posts

Question:

Event Callback after Asynchronous Python Method Completes?

Sep 02 '15 at 22:28

After looking at a number of the new async methods available, it appears that one is always obliged to poll to determine when the async task is complete.

It would seem much more useful and natural if a callback could be provided when the task is doneā€”am I missing something? I am specifically interested in the Python library.


Answer

The issue is whether or not event callbacks are supported for the language. For C#, C++, VB.NET, Objective-C, most ActiveX cases (Delphi, VB6, Foxpro, etc.), and most recently Java, the answer is Yes. When the background task completes, the TaskCompleted callback is called. Unfortunately, for Python, Chilkat hasn't yet worked it out (and I'm not sure what's possible). The Chilkat libs are written in C++, and that means a call from C++ back into Python.