Menu
  • HOME
  • TAGS

Trouble with subscribing to keyspace notifications

node.js,redis,node-redis

I was misunderstanding the docs. The channel is __keyspace:0__:bull:Test Queue:wait and the message is rpush, lpush, etc. Alternatively, the channel could be: __keyspace:0__:rpush and the message would be bull:Test Queue:wait. Thank to Jan-Erik Rediger who helped me out on the discussion board....

Redis callback upon persistence on disk

redis,node-redis

No, it`s not possible. Yes, it's unnecessary to update key in Redis if in memory and disk data is different. Also, you can (but your realy do not want to this in production in most of cases) force saving data to disk with BGSAVE or SAVE. Please read about redis...

Nodejs and redis structured data

javascript,node.js,data-structures,node-redis

You should instead use client.hmset ("123456789", "acc_x", "val 1", "acc_y", "val 2") Refer the following links : http://redis.io/commands/hmset https://github.com/mranney/node_redis/blob/4f9c6bd21912b1404089777d4e409d7a55ce1250/test.js...

Redis queue in Node.js cluster environment

node.js,redis,node-redis

It looks like kue is just what we need. Minimal test program queuing tasks via Redis in a Node.js clustered environment: // cluster-queue.js var kue = require('kue'); var cluster = require('cluster'); var numWorkers = process.argv[2]; var numParallel = process.argv[3]; var jobDelay = process.argv[4]; var numJobs = process.argv[5]; if (process.argv.length !==...

Wait for several db connections before starting express server?

node.js,postgresql,asynchronous,express,node-redis

Promises are what you want. You can use .all() on an array of promises to wait for them all to complete. You didn't mention what Promise library you're using, but it's fairly universal. here's the Bluebird documentation: https://github.com/petkaantonov/bluebird/blob/master/API.md#all---promise...

How remove one element with a score in Redis?

redis,node-redis

This is the full documentation of that call: http://redis.io/commands/zremrangebyscore It looks like for your case, ZREMRANGEBYSCORE key 1417727661 1417727661 is correct. Remember that the ranges are inclusive by default. You can make them exclusive by following the syntax on this page: http://redis.io/commands/zrangebyscore ZREMRANGEBYSCORE key 1417727661 (1417727662 means scores greater than...

Connecting to redis using kue always creates a connection to localhost

node.js,redis,node-redis,kue

I used a different way to setup the connection and it works so far this is what I've done: app.redisClient = redis.createClient(config.redisPort, config.redisUrl,{}); app.redisClient.on('connect', function () { console.info('successful connection to redis server'); }); app.redisClient.on('error', function (err) { console.log('Redis error encountered', err); }); app.redisClient.on('end', function() { console.log('Redis connection closed'); }); kue.app.listen(config.kuePort);...

Nodejs Azure Redis Cache hang forever and read ECONNRESET error

node.js,caching,azure,node-redis,azure-redis-cache

New caches only have the SSL endpoint (port 6380) enabled by default. Some clients (like redis-cli) do not support SSL. You would need to check if node-redis supports SSL. You will get erorrs if you try to connect to the SSL port with a client that doesn't support SSL. If...

node_redis: is SMEMBERS blocking?

node.js,redis,node-redis

Almost all of Redis' commands are blocking, SCAN included (it guarantees short execution time however). The only commands that are non-blocking are those performed by other threads (currently persistence-related only, e.g. BGSAVE). Specifically, SMEMBERS is blocking. This can be ok if your Set isn't too large (a few K's perhaps(....

Node.js and node_redis - Parsing HGETALL response to Jade template (Object with Buffers)

json,node.js,jade,node-redis

For anyone else who encounters this issue, I solved it by parsing the child item: -for(var prop in all) #{prop} -var ob = JSON.parse(all[prop]) Now ob properties can be accessed using dot notation....

How to get all data from Redis to JSON

json,node.js,asynchronous,redis,node-redis

I would try using async module https://github.com/caolan/async to make it async. redis = require('redis'); client = redis.createClient(); client.send_command('select', [10], redis.print); var r = {}; client.keys('*', function(err, keys) { async.each(keys, function(key, callback) { client.get(key, function(err, value) { r[key] = value; callback(err); }); }, function() { // when callback is finished console.log(JSON.stringify(r));...

node_redis get zrange withscores

node.js,redis,node-redis

This code looks good. Check out the following link for retrieving what you want : http://ricochen.wordpress.com/2012/02/28/example-sorted-set-functions-with-node-js-redis/...

How to remotely inspect data with Heroku / RedisCloud / Node.js

node.js,heroku,redis,node-redis

redis-cli isn't a Ruby tool, it is a standard part of the Redis package. The easiest way of getting on your Mac is to download and build Redis from https://github.com/antirez/redis. Once you've done that, your laptop will be able to use the compiled binary. Note that when in a bind...

connect-redis and express-session results in req.session undefined

node.js,session,express,node-redis

You probably have some connection errors, but connect-redis does not output them to console (see connect-redis source code). To see them you can create a separate module that creates a client instance and pass it to RedisStore constructor: // redisClient.js var redis = require('redis'); var redisClient = redis.createClient('localhost', 6379); //...

Redis: intersection of sorted sets by score

node.js,google-app-engine,redis,node-redis,sortedset

I'd like to ignore the use case (locations paths/distances) itself because there are multiple proven ways to address this challenge, also with Redis (search for geospatial and ye shall find), and focus instead on the technique. So, assuming you're going to invent and implement your own geo logic, the most...