Hello!
2014-05-15 0:02 GMT-07:00 Xing Lao:
> 公司现在打算用lua做一套分布式图片上传管理平台,前几天忙着在做demo,通过lua-resty-upload扩展获取到切割后的图片流(chunk_size为4096),之后怎样把这些分割的流发送到fastDFS去呢?
>
原理上就是走 ngx_lua 的 cosocket API:
https://github.com/openresty/lua-nginx-module#ngxsockettcp
使用的具体的线路协议你需要参考 FastDFS 的相关文档或代码了,因为是特定于 FastDFS 的了。可以参考
lua-resty-mysql 和 lua-resty-memcached 这样现成的客户端库的实现(不过它们分别实现的是 MySQL 和
Memcached 的线路协议)。
Regards,
-agentzh
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 openresty@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html