You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] to close the response output stream early: "response:eof()" #4
In nginx-lua/openresty, I can close the http response early (avoid my users waiting) and continue doing things that cost time on my server:
ngx.say("bye bye, my user")
ngx.eof()
local http=require"httpc".create()
http:request{method="GET", url="https://a web page of very long content"}
local data,err=http:read"*a"
Does the Mako web server have such an API? for example: response:eof()
changed the title [-][Feature Request] Explicitly close the response output stream: "response:eof()"[/-][+][Feature Request] to close the response output stream early: "response:eof()"[/+]on Sep 18, 2022
<html>
<body>
<?lsp
response:write("Hello World<br/>")
local function q()
local http=require"httpc".create()
http:request{method="GET",
url="https://a web page of very long content"
}
local data,err=http:read"*a"
os.execute("/usr/bin/sudo /home/malcolm/lcus1.sh")
end
ba.timer(q):set(0)
?>
</body>
</html>
In mako, you would do the following to end the response (you defer the execution of the http client):
ba.thread.run(function()
local http=require"httpc".create()
http:request{method="GET", url="https://a web page of very long content"}
local data,err=http:read"*a" end)
Activity
[-][Feature Request] Explicitly close the response output stream: "response:eof()"[/-][+][Feature Request] to close the response output stream early: "response:eof()"[/+]diyism commentedon Sep 18, 2022
Although there's another async method:
Mako seb server is very slim and strong.
surfskidude commentedon Sep 19, 2022
In mako, you would do the following to end the response (you defer the execution of the http client):
ba.thread.run(function()
local http=require"httpc".create()
http:request{method="GET", url="https://a web page of very long content"}
local data,err=http:read"*a" end)