Background thread, async and GUI (dlangui)

Bagomot bagomot at gmail.com
Tue Jul 12 18:47:03 UTC 2022


On Monday, 11 July 2022 at 09:32:46 UTC, evilrat wrote:
>   curl.onProgress = delegate int(size_t dltotal, size_t dlnow, 
> size_t ultotal, size_t ulnow)
>   {
>     // even though onProgress can be run in another thread this 
> delegate will be run on next UI tick
>     executeInUiThread( (){ 
> progressBar.setProgress(dlnow/dltotal * 100); } );
>     return 0;
>   };
>   curl.perform();
> }
> ```

Yes. Thanks, I did just that for the download.

I now have a couple more questions about `Task`:
1) How to run a non-static class method through `task`?
2) How to use `taskPool` to run a series of tasks of the same 
type (from question 1)?



More information about the Digitalmars-d-learn mailing list