There should be more atomic commits but the whole thing was a mess. This
commit changes the synchrounous Redis connection into an asynchronous
one in its own class RedisConnection.
The RedisConnection uses a Workqueue with commands to fire against the
Redis server. When a response is required a callback must be supplied,
refer to RedisWriter::RedisGet().
Known Issues:
- Authentication has no error handling and can break the connection
- Error handling in general is iffy due to the nature of the async redis
connection
- Getting a reply out of RedisConnection is not trivial
- HandleRW... sunt dracones
icinga:config:object:<type>:<sha1>
icinga:config:checksum:<type> <sha1>
icinga:config:customvar:<type> <sha1>
icinga:status:object:<type>:<sha1>
This avoids multiple definitions all over the code. Maybe we want
to make the schema configurable at some point.
Use case: a reader subscribes to config changes. As they happen rarely, chances
are good that the connection will time out in the meantime. Now, a reconnect is
easy - but you wouldn't know whether you missed any config changes. So you are
required to issue a new sync to be on the safe side. Given a 60sec connection
timeout (think: SSL layer, firewalls etc) when no traffic happens this would be
too expensive.
Some kind of a heartbeat available for subscription would allow subscribers to
artificially keep the connection alive. As a first simple solution to this I'd
suggest to publish CIB data, that might be useful anyways.
refs #4991fixes#5098
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>