由于对lua及openresty理解不是很深刻,想在这里与大家一起讨论学习下。
我原来用lua做了个http 动态反向代理(https://github.com/luohoufu/httpproxy)的东西,算是自己在openresty及lua上的第一次实践。
openresty对http协议的支持是相当好的,开发起来也方便,但我在讨论列表中搜索只找到了对thrift支持为数不多的几篇帖子。
https://groups.google.com/forum/#!searchin/openresty/cosocket$20thrift/openresty/Te-1ms4uDTc/brjdZ7rFBQAJ
https://groups.google.com/forum/#!searchin/openresty/thrift/openresty/N7A44_rt-5M/fAAZOSX5BwAJ
https://groups.google.com/forum/#!searchin/openresty/thrift/openresty/UgeHqqlRiYo/y0dywZIFBwAJ
目前,项目有了些变化。为了提高java及php程序间的执行性能,引入了thrift通讯。对原来http反向代理有了新的要求。
通过http(http/2)来连接openresty,再由openresty对ThriftServer建立长连接,然后将Thrift结果解析为json响应。
Openresty是高性能在于 event-driven, asynchronous, single-threaded, non-blocking ,该如何结合Thrift的TCompactProtocol、TNonblockingTransport、NonblockingServer做成高性能的?
同时,具体是在lua里实现,还是在c里实现?
讨论组里有相关经验的老师,麻烦指导我一下。
另外,我想深入学习入lua及openresty,推荐一下学习的github项目及book。
不胜感谢!