Welcome! Log In Create A New Profile

Advanced

How to organize module that interacts with Redis Asynchronously?

Posted by regall 
How to organize module that interacts with Redis Asynchronously?
July 29, 2011 08:32AM
Hi. I've got a problem when writing nginx module. For now my module adds handler to NGX_HTTP_ACCESS_PHASE. That handler connects to redis and makes it's operations to check if request has rights to go further. That's not good because I'm using blocking API (cRedis lib). I'd like to user hiRedis async API to avoid socket blocks. What's the best way to organize module architecture to do that task?

Thank you
Re: How to organize module that interacts with Redis Asynchronously?
July 30, 2011 03:46AM
While reading nginx modules code I came to a thought that the best way to implement such login is a creating handler dealing with upstream so it will avoid blocking. This aproach resolves my issue but requires more programming as it is required to implement redis protocol by myself. It's good that the protocol is very simple and I actually don't need to implement the whole. Will it be a nice solution of my problem?

Thank you
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 82
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready