Open jd-solanki opened 9 months ago
Yeah, it would be great to have an async example in the doc. There are some examples on Discord that can be used as a starting point; they probably need some polishing though.
Hey, I'm working on this right now, I'll leave a message with my result. its gon jus be a file on my github you can look at. i've been working on something for another private project but this kind of overlaps so i think its cool and it'll be a good excersise.
https://github.com/EloniX-X/api-loading-in-pygui
heres the repo with the loading, i made a lil quick server type thing i dont know if its good enough but i may use it myself this is my first time solving other peoples problems and i use dearpygui all the time I dont know about using globals in threads i talked to someone once and they told me it was bad but im not entirely sure
I did not use just dearpygui i also used threading for the same time stuff requests for the simple api thing but you can really replace that with anything and theres time in there but you dont need it and i should remove it from legacy code which i may do tomorrow so you only really need threading
if you need more code for it i will give some from my private gits, i've done some same time stuff before and i dont mind spending 10 mins doing some quick things
My Improvement
I'm glad to checkout that dearpygui support async. However, I was looking at docs and wanted to build app that heavily relias on API calls and want to show loader until API call is finished. I'm unable to see any async example in doc and also tried searching repo issues but can't find anything useful.
Necessary Assets
For example we have delay res from httpbin and func that makes API call then how to handle this with dearpyGui:
https://httpbin.org/delay/5