Task.after readwrite property



This property is used to define the function to be called once the Task is terminated.

When set, this function is called with the Task return values as arguments.

Example

local net = require "net" -- The Http:get() method returns a Task value local client = net.Http("https://wttr.in"):get("/Paris?format=3") -- Set the client.after property, which take two arguments (the client and the response table) function client:after(response) print(response.content) end -- This could have been written this way too : -- net.Http("https://wttr.in"):get("/Paris?format=3").after = function(client, response) -- print(response.content) -- end waitall()