0

I'm trying to implement an event system.

Node subscribes to Redis channel, receives message and calls non-existent method in object.

Complete code is here. Simple. http://pastebin.com/8XnbaepE Why error is not thrown?

I don't understand this behaviour.

Another strange problem is that after first time publishing message to channel next times when different channel and payload passed, the function arguments are old one.

What am I missing?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Tigran Tokmajyan
  • 1,937
  • 7
  • 25
  • 36

2 Answers2

0

If you don't get an exception, this means node-redis caught it, and did not re-throw. This is actually a good practice in async i/o code as this will prevent node from exiting and killing your server.

Most likely you'll see your error if you register a callback on error.

sub.on("error", function(err) {
  // deal with error
  // ...
}
Pascal Belloncle
  • 11,184
  • 3
  • 56
  • 56
0

This was a bug in node redis module.

https://github.com/mranney/node_redis/pull/361

Tigran Tokmajyan
  • 1,937
  • 7
  • 25
  • 36