Awesome, thanks! I’m passing a TFunction in now (should’ve thought of that). What do you mean re. ‘It doesn’t allow for payloads’? Is it that it can only take static functions, and not those called as member functions on an object?
Additionally, how can I make sure that my FAsyncTask is destroyed? I want to fire it off with the delegate/TFunction bound, let it do its work, then have that delegate/TFunction execute. After that, the task would ideally be cleaned up. I presumed that the task pool/queue would destroy tasks when they’ve been completed? This doesn’t seem to be the case, and obviously calling delete this from inside DoWork is not possible.
Actually, now that I think of it… how does one make sure that the delegate/TFunction is executed on the main thread? You say to make sure that the delegate handler is thread-safe, but I’m afraid I can’t make the connection between that and this.
Thanks again.