Initial Dever 0.0.1
This commit is contained in:
commit
81233d098c
1479 files changed
+163782
No files matched your search
@@ -0,0 +1,48 @@
|
||||
# 流式响应
|
||||
|
||||
在请求处理函数中按块发送响应,结束时释放会话资源。
|
||||
|
||||
## dever.http.LiveLimits
|
||||
|
||||
逐块限额及空闲期限,心跳期限必须短于空闲期限。
|
||||
|
||||
字段:
|
||||
- `chunk_bytes`:单块上限
|
||||
- `idle_ms`:普通流空闲期限
|
||||
- `heartbeat_ms`:SSE 心跳周期
|
||||
|
||||
## dever.http.defaultLiveLimits
|
||||
|
||||
默认每块 64 KiB、空闲期限 60 秒、心跳间隔 15 秒。
|
||||
|
||||
## dever.http.serveLive
|
||||
|
||||
处理可分块回复的 HTTP 请求,route 通过 reply 写入响应。
|
||||
|
||||
## dever.http.serveLiveTls
|
||||
|
||||
使用 TLS 处理可分块回复的 HTTP 请求。
|
||||
|
||||
## dever.http.respond
|
||||
|
||||
通过 reply 一次发送完整响应。
|
||||
|
||||
## dever.http.start
|
||||
|
||||
发送流式响应的状态码和响应头。
|
||||
|
||||
## dever.http.write
|
||||
|
||||
向已开始的流式响应写入一块正文。
|
||||
|
||||
## dever.http.finish
|
||||
|
||||
结束流式响应。
|
||||
|
||||
## dever.http.wroteLive
|
||||
|
||||
写入成功时继续执行,失败时传播错误。
|
||||
|
||||
## dever.http.closedLive
|
||||
|
||||
结束响应成功时继续执行,失败时传播错误。
|
||||
Reference in new issue
Block a user