Skip to content

Instantly share code, notes, and snippets.

@Elv13
Created March 7, 2014 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elv13/9414500 to your computer and use it in GitHub Desktop.
Save Elv13/9414500 to your computer and use it in GitHub Desktop.
function module.download_text_async(url)
local req = create_request()
print("starting",url)
gio.File.new_for_uri(url):load_contents_async(nil,function(file,task,c)
local content = file:load_contents_finish(task)
print("called",content)
if content then
req:emit_signal("request::completed",tostring(content))
end
end)
return req
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment