SwiftNIO Redis Client

All, I've made some heavy revisions based on feedback so far and have pushed publicly.

You can see the changes on master (or by pulling the 0.2.0 pre-release tagged version): mordil/nio-redis

For a diff, you can see the pull request

Here is an overview of the changes:

Renaming

  • Redis module (Dispatch abstraction) has been changed to DispatchRedis
  • RedisData and references to it have been changed to RESPValue or just RESP
  • NIORedis (the class) has been renamed to RedisDriver
  • Other NIO* types have lost the NIO prefix
  • RedisMessenger is now RedisCommandHandler
  • NIORedis.ExecutionModel is now RedisDriver.ThreadOwnershipModel

Public Interface

  • RESPDecoder and RESPEncoder are now public, as well as their respective parsing methods.
  • RedisCommandHandler is now an open class
  • isRunning and isClosed properties are now immutable and public
  • RedisPipeline (formerly NIORedisPipeline) now has a count property of how many commands have been queued.

Implementation

  • RedisCommandHandler (formerly RedisMessenger) has been completely re-written as a ChannelDuplexHandler that works more through protocol method invocations by NIO than before - while still providing a way to queue callbacks to receive Redis command responses
  • RedisPipeline has been completely re-written to more directly work with NIO Channel by creating a new construct RedisCommandContext that is used by RedisCommandHandler