[Discussion] NIORedis: NIO-based Redis Driver

Post-vacation update:

I've re-evaluated the implementation of RedisPipeline for the purpose of controlling how frequently flushes were done in addition to batching up commands to receive all in a single EventLoopFuture.

This is the direction I have decided to head towards (PR #36):

  1. In my opinion, the feature to batch up commands into a single EventLoopFuture is a great one - but not a necessary one for this low level of a driver.
    A higher level library such as RedisKit could attempt to implement this, or it can be re-implemented at a later date if deemed necessary to be at this level.
    • To this effect, RedisPipeline has been deleted
  2. A new sendCommandsImmediately property has been added to RedisConnection to control the “autoflush” nature of send(command:with:)
    • When it is set to false, write will be the method called, with the timing of flushes handled by the host machine / NIO.
    • When set to true, writeAndFlush will be called instead, and setting this will trigger a channel.flush().

As always, I'm open to discussing to this decision.

Implement feedback is welcome through GitHub.

1 Like

To address this more wider ranging namespacing problem (that we might or might not try to solve now) I created a separate thread.

The only relevant bit to this proposal is that the NIORedis module name is already in use by a package that has been tagged since at least a year ago. Given that Swift does not support two modules with the same name in a given binary, I strongly believe that we have to re-name this module to something else. Sure, module clashes will happen anyway but the SSWG must do everything it can to prevent module clashes from happening wherever possible. Btw, I just pitched a tightening of the uniqueness rules for SSWG packages.

Do I have a good name-proposal? I know that NIORedis and RedisClient are already in use, so maybe RedisClientNIO or AsyncRedisClient?

Btw, this Github advanced search to work quite well to search for modules:

https://github.com/search?l=&q=NAME_OF_THE_MODULE+filename%3APackage.swift+language%3ASwift&type=Code

Which will search only the 'code' of Package.swift files for a mention of NAME_OF_THE_MODULE. For the repo name nio-redis seems to still be available, so we could leave it like that or make it nio-redis-client?

feedback thread: [Feedback] RedisNIO: A NIO-Based Redis Driver