Comments (11)
- 大文件上传,稍后加入
- reqiure 的虚拟主机路径支持,也会加入
- header 和 body 的设置稍后会,并入到 host-route.lua 进行统一配置
- 代码缓存的ttl请在命令行使用 code-cache-ttl=0 参数
from alilua.
好的。
from alilua.
require 的虚拟主机路径已加入(但 require 会缓存结果,多个虚拟主机会出现命名冲突;可在 core.lua 打开防止冲突的支持。因为影响性能,所以未默认打开)
request header body等限制已加入,稍后再整理需求进行补充(在 host-route.lua 配置文件增加 config 配置)
而大文件上传,待 AIO 封装好会补上。这个工作量比较大。预计下一版本实现
from alilua.
非常感谢oneoo。
还有个建议,对于大文件上传,建议也实现一组non-blocking的操作文件的api(类 io.* api),还有在实现AIO 封装上,希望做到平台无关,让mac和freebsd也能用上,我是在freebsd上运行alilua的。
from alilua.
对于require的命名冲突,建议还是每个虚拟主机一个不相关的state吧。
from alilua.
多个 state 会带来更多开销,1是查找对应的state,另外消耗更多内存。
如果不希望影响性能,而又要避免 require 的命名冲突。还有个方法是把模块文件放在一个特殊的目录下。
比如:
/a.com/a-com-lib/m.lua
require('a-com-lib.m')
from alilua.
已改写 Lua 原生的 require 方法,支持虚拟机的代码缓存隔离,且支持缓存生命时间设置(跟 code cache 一致)
from alilua.
感谢。^ ^
from alilua.
重写 HTTP Parse并引入 eio 伪非堵塞IO。以实现流式处理
例子:
local key,val,need_chunk_read,file_name,file_type = next_post_field()
while key do
print(key,val,need_chunk_read,file_name,file_type, "\n")
if need_chunk_read then
local fh,en,e
if file_name then
fh,en,e = eio.open('/tmp/a', 'w')
if not fh then
_print(fh,en,e)
end
end
local chunk = read_post_field_chunk()
while chunk do
print('[', file_name and #chunk or chunk, ']', "\n")
if file_name then fh:write(chunk) end
chunk = read_post_field_chunk()
end
if file_name then fh:close() end
end
key,val,need_chunk_read,file_name,file_type = next_post_field()
end
from alilua.
赞!^ ^
from alilua.
done
from alilua.
Related Issues (20)
- add libeio HOT 1
- recode HTTP parser HOT 1
- popen in routes.lua? HOT 5
- HTTPS support HOT 1
- HTTP Chunk output HOT 1
- mac pro compile error. HOT 6
- alilua里面如何处理HTTP POST文件上传的? HOT 1
- llvm版本6.0 在mac osx上编译报错。 HOT 12
- 希望增加一个基于websocket的chat server的 sample。 HOT 1
- 咱们建一个QQ群如何? HOT 1
- websocket example error? HOT 4
- Install error HOT 1
- CodeCache没地方定义它 HOT 2
- 使用mysql报错 attempt to yield across C-call boundary stack traceback HOT 5
- 关于代码中魔数和全局变量的问题
- 想用在openwrt上构建web服务,但是内存占用过高 HOT 3
- var stat = fs.statSync(file); 是在黑Node吗 HOT 1
- 持续开发吗 HOT 1
- readfile函数读的文件内容都是nil HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alilua.