Subscribe via RSS Feed

Execute Redis Commands with Node.js without Driver

May 22, 2015 0 Comments

We had written about redis commands through node.js previously. fjällräven kånken big Below is a code snippet, where we have connected and executed redis commands from node.js without using any driver. Nike Air Max Pas Cher Steps taken – 1> First we have started Redis in our machine. 2> We have written a bare minimum socket program to connect the redis host and port( 127.0.0.1 and 6379). nike blazer pas cher below is connection related code – client.connect method… nike tn pas cher 3> In connect method, we have written the commands of Redis. sac a dos kanken pas cher (Some examples are SET, GET, ECHO and PING ) The most important part here is the EXEC command of redis, which will execute all the commands in Queue. Adidas Homme 4> We have taken callback from ‘data‘ and ‘close‘ event in node.js In data event callback, we have got the response from Redis Server. 5> In ‘close’ event we have got callback for socket closing. Here the work is only for exploration purpose. We will create more structural classes for redis data handling in future, for which we will update important parts in next posts. Below is the code.

Leave a Reply

You must be logged in to post a comment.