Package redisbroker implements a juggler broker using redis as backend. RPC calls and results are stored in redis lists and queried via the BRPOP command, while pub-sub events are handled using redis' built-in pub-sub support.
Call timeouts are handled by an expiring key associated with each call request, and in a similar way for results. Keys are named in such a way that the call request list and associated expiring keys are in the same hash slot, and the same is true for results and their expiring key, so that using a redis cluster is supported. The call requests are hashed on the call URI, and the results are hashed on the calling connection's UUID.
If an RPC URI is much more sollicitated than others, it can be spread over multiple URIs using "RPC_URI_%d" where %d is e.g. a number from 1 to 100. Clients that need to call this function can use a random over that range to spread the load over different cluster nodes, or a server handler can alter the URI to achieve that result without impacting clients.