redis2-nginx-module-master module usage from other modules

47 views
Skip to first unread message

Ajay Bodhe

unread,
Aug 12, 2014, 10:37:40 AM8/12/14
to openre...@googlegroups.com
I guess redis2-nginx-module-master only allows redis access through configs
If I wanna access redis from another openresty C module can it be done?
Is it possible to call one modules code from another module?

Yichun Zhang (agentzh)

unread,
Aug 12, 2014, 2:52:57 PM8/12/14
to openresty-en
Hello!
Yes, via nginx subrequests. You can check out ngx_echo's
echo_subrequest directive or ngx_lua's ngx.location.capture()'s
implementation for such examples.

But as I've said in an earlier thread, it's much easier, more
efficient, and also more flexible to just use cosocket-based Lua
drivers like lua-resty-redis to do such things.

We created the ngx_lua module 5 years ago because we had got tired of
coding complicated nginx C modules which did not give much gain but
just a lot of pain. I can assure you that you won't have fun perusing
the pure nginx C module development route ;)

Regards,
-agentzh
Reply all
Reply to author
Forward
0 new messages