inverse-inc/packetfence — pull request #171 by mullagain (2014-06-23 17:18:29+00:00)
Title: Feature/redis

Added pf::ipc module to extend Redis::Fast. It also using JSON::XS for data serialization.

I have implemented the following methods.
enqueue - add a string/hash/array to a redis list (perl push). Auto serialization
dequeue - pull something off of a redis list (perl shift). Auto serialization.
queueCount - get a count of items on a redis list.
pfpublish - redis publish with automatic serialization
pfSubscribeHander - de-serialization of a published method (used with subscribe)

I have also included sbin/pftrapp that uses the native perl extension features of snmptrapd. This script breaks a trap into a hash and publishes it. This could work similar to tailing a log file, but a lot less complex and very fast as it all happens in memory.

Redis should be configured to be persistent in this case, and if there is a standby server redis should be configured with a slave.

This should greatly improve any ipc in terms of complexity and speed. It should also allow us to move away from the very slow and inefficient threaded perl.

It should also help with the active/active initiative as we could move more of the config into redis (SQL is overkill and inefficient for config)

This currently does not support serialization of classes.

For review, discussion and merge.