I want to download a file in background, using LuaSocket HTTP. But I was only able to find information about the blocking API, i.e. everything stalls while I’m downloading this file. Any ideas on how to do it? [import]uid: 6795 topic_id: 2597 reply_id: 302597[/import]
Right now any internet access happens in the foreground. Async access is on our future feature list.
-Tom [import]uid: 7559 topic_id: 2597 reply_id: 7400[/import]
Thanks Tom.
Is there any way I can force the rest of the UI to update, e.g. to show a progress bar? Right now, it appears like the whole app is freezing, even music stops playing! The only thing that still seems to update is the native activity indicator. Can something be done with coroutines perhaps? [import]uid: 6795 topic_id: 2597 reply_id: 7414[/import]
Coroutines may help but I’m not sure anyone has tried to get that working. Async HTTP is high on the features list for things to do.
Thanks,
-Tom [import]uid: 7559 topic_id: 2597 reply_id: 7443[/import]
Coroutines cna only help if you load a bunch of small files. If you are downloading a big file, the whole app freezes till that download is done. There is nothing you can do as a workaround right now. [import]uid: 5712 topic_id: 2597 reply_id: 7454[/import]
Well that leaves me pretty much dead in the water for this app 
Tom: can you give any indication when you expect this will be made available? Is there anything I can do to accelerate the development? I’d be willing to pay a bounty if the price is reasonable… [import]uid: 6795 topic_id: 2597 reply_id: 8002[/import]
I think async access is something we developers really really need… it’s so frustrating to see the app freezing completely when it’s accessing the network.
Great to hear that this function is high on the feature list for things to do… however, please, could you release an updated roadmap, so we can have an idea about what features can we plan to use in the future? [import]uid: 9158 topic_id: 2597 reply_id: 8203[/import]
I found a workaround. It’s not pretty, and I still very much would like official support for async http, but for now, check out: http://developer.anscamobile.com/code/corona-async-http [import]uid: 6795 topic_id: 2597 reply_id: 10041[/import]
I am having some difficulty in using the code sample at http://developer.anscamobile.com/code/corona-async-http.
I am calling async_http.request (“http://www.mysite.com/test.asp”, “testfile.tmp”, onCompleteCallback, onErrorCallback)
But the file testfile.tmp is not created.
Can you give an example of how to call async_http.request and how to set the parameters.
[import]uid: 6661 topic_id: 2597 reply_id: 10992[/import]