Async requests? #11

Open
opened 2015-03-01 13:04:32 +00:00 by mbrovko · 3 comments
mbrovko commented 2015-03-01 13:04:32 +00:00 (Migrated from github.com)

Seems like requests freeze an app for a few seconds.
Certainly, need a way to find a solution to make it more.. async?

Seems like requests freeze an app for a few seconds. Certainly, need a way to find a solution to make it more.. async?
pablomayobre commented 2015-03-01 19:32:24 +00:00 (Migrated from github.com)

The API for async is kinda framework dependant, LÖVE has threads but I dont know if this feature is available in other frameworks (it is not available in Lua itself)

Maybe start a new project that requires this lib and makes it async just for LÖVE, I started something but is no where near to be published (No time for it right now)

Not sure how it could be done for other apps

The API for async is kinda framework dependant, LÖVE has threads but I dont know if this feature is available in other frameworks (it is not available in Lua itself) Maybe start a new project that requires this lib and makes it async just for LÖVE, I started something but is no where near to be published (No time for it right now) Not sure how it could be done for other apps
mbrovko commented 2015-03-01 19:45:25 +00:00 (Migrated from github.com)

Maybe there's something included for that in LuaSocket. Gotta research a bit.

Maybe there's something included for that in LuaSocket. Gotta research a bit.
pablomayobre commented 2015-03-01 20:10:11 +00:00 (Migrated from github.com)

Okey then check this and this

Some people also suggest coroutines but I dont think that may work (it does work when you need more than one request but that is not the case)

Other option is modifying the http.request function, so that we get chunks of the data in every update, and when the download or upload of data is done we can close the connection and call the callback. Not really sure if this would work though (plus it may not be very friendly to the GameJolt server)

Okey then check [this](http://w3.impa.br/~diego/software/luasocket/old/luasocket-2.0-alpha/http.html#request_cb) and [this](http://w3.impa.br/~diego/software/luasocket/old/luasocket-2.0-alpha/stream.html#stream) Some people also [suggest coroutines](http://www.lua.org/pil/9.4.html) but I dont think that may work (it does work when you need more than one request but that is not the case) Other option is modifying the http.request function, so that we get chunks of the data in every update, and when the download or upload of data is done we can close the connection and call the callback. Not really sure if this would work though (plus it may not be very friendly to the GameJolt server)
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: library-mirrors/gamejoltlua#11
No description provided.