1. 06 Jun, 2019 2 commits
    • Nathan Harris's avatar
      Rename `NIORedis` to `RedisNIO` · e81f9546
      Nathan Harris authored
      Motivation:
      
      The SSWG has identified a fast approaching reality of namespace clashes in SPM within the ecosystem and has proposed a rule on names that `NIORedis` no longer complies with.
      
      Modifications:
      
      All references to `NIORedis` have been switched to `RedisNIO` as this module name is unique (at least within GitHub's public repositories).
      
      The goals for this name are as follows:
      
      1. To indicate that this is a Redis client library that is built with SwiftNIO
      2. That it is a lower level library, as it directly exposes SwiftNIO as an implementation detail
          2a. The idea being that a higher level library (`Redis`) will be used, and to "go one level deeper" in the stack, you append the "deeper" `NIO` postfix
      3. It follows a naming pattern adopted by Vapor who has expressed their desire to adopt this library as their Redis implementation
      
      Result:
      
      A repository, package name, and module name that are unique across GitHub's public repositories that achives the goals outlined above.
      e81f9546
    • Nathan Harris's avatar
      Merge pull request #41 from Mordil/40-metrics · 7ae20244
      Nathan Harris authored
      Implement Basic Metrics (#40)
      7ae20244
  2. 05 Jun, 2019 2 commits
    • Nathan Harris's avatar
      Implement Basic Metrics (#40) · 9df65396
      Nathan Harris authored
      Motivation:
      
      End users will want to capture some baseline performance metrics that can only be accurately gathered at this level of the stack.
      
      Modifications:
      
      Added new `RedisMetrics` struct that retains all SwiftMetrics objects used throughout the system lifecycle, and appropriate code to track desired metrics.
      
      Result:
      
      Users now have a way to peek into the system's performance to understand what NIORedis is being asked to do from their usage.
      9df65396
    • Nathan Harris's avatar
      Add Xcode 11 `.swiftpm` to `.gitignore` · 0b284912
      Nathan Harris authored
      0b284912
  3. 28 May, 2019 1 commit
    • Nathan Harris's avatar
      Update License Notice for SwiftLog & SwiftMetrics · b0d0882e
      Nathan Harris authored
      Motivation:
      
      The project has adopted the `swift-log` and `swift-metrics` API packages, and the project's license needs to include attributions to their authors.
      
      Modifications:
      
      `NOTICE.txt` now lists `swift-log` and `swift-metrics` from Apple.
      
      Result:
      
      Apple has been properly attributed for the code from `swift-log` and `swift-metrics`
      b0d0882e
  4. 27 May, 2019 5 commits
    • Nathan Harris's avatar
      Merge pull request #43 from Mordil/blocking-pop · f6facaa2
      Nathan Harris authored
      Add Blocking List Pop Commands
      f6facaa2
    • Nathan Harris's avatar
      Add Blocking List Pop Commands · eaa9d2bf
      Nathan Harris authored
      Motivation:
      
      To be a comprehensive library, all commands should be implemented, even if they are highly discouraged. List's collection of commands were missing `brpop`, `blpop`, and `brpoplpush`.
      
      Modifications:
      
      `brpop`, `blpop` and `brpoplpush` are supported with defaults and overloads for an easier API.
      
      Result:
      
      Users now have access to `brpop`, `blpop` and `brpoplpush` commands.
      eaa9d2bf
    • Nathan Harris's avatar
      Merge pull request #42 from Mordil/blocking-zpop · 0c4db212
      Nathan Harris authored
      Add Blocking Sorted Set Pop Commands
      0c4db212
    • Nathan Harris's avatar
      Add Blocking Sorted Set Pop Commands · 73922325
      Nathan Harris authored
      Motivation:
      
      To be a comprehensive library, all commands should be implemented, even if they are highly discouraged. Sorted Set's collection of commands were missing `bzpopmin` and `bzpopmax`.
      
      Modifications:
      
      `bzpopmin` and `bzpopmax` are supported with defaults and overloads for an easier API.
      `RedisClient.channel` is now `internal` to have access during testing for bypassing normal guards for closing connections.
      
      Result:
      
      Users now have access to `bzpopmin` and `bzpopmax` commands.
      73922325
    • Nathan Harris's avatar
      Improve Redis Channel Pipeline Debugging · d0da3e76
      Nathan Harris authored
      Motivation:
      
      Debugging and properly handling errors was difficult as the `ChannelHandler` names were the default generic names, in addition the `RedisCommandHandler` did not pipe errors further up the pipeline.
      
      Modifications:
      
      `RedisCommandHandler` now calls `context.fireErrorCaught(error)` when receiving errors, and the default Redis `ChannelPipeline` handlers are added with debugging names.
      
      Result:
      
      It should be easier for debugging purposes to work with any Redis `ChannelPipeline`.
      d0da3e76
  5. 18 May, 2019 1 commit
  6. 02 May, 2019 3 commits
    • Nathan Harris's avatar
      Minor comment fixes · d9d61baf
      Nathan Harris authored
      d9d61baf
    • Nathan Harris's avatar
      Tweak README formatting · 3eb76087
      Nathan Harris authored
      3eb76087
    • Nathan Harris's avatar
      Update Readme and Tweak `Redis.makeConnection(...)` · 0131fe43
      Nathan Harris authored
      Motivation:
      
      The goal of the `Redis.makeConnection` factory method is to provide end users with a quick way to jump in and get started with Redis in Swift.
      
      Right now, users have to provide an `EventLoopGroup` instance, when a reasonable default is available for us to define.
      
      Modifications:
      
      - Add: `MultiThreadedEventLoopGroup` for 1 thread as a default argument to the `using:` label in `Redis.makeConnection`
      - Remove: The `with:` label for the password in `Redis.makeConnection`
      - Change: The project README to reflect the current state of the project
      
      Results:
      
      Users should be able to create `RedisConnections` by just defining an IP Address & Port to connect to - and possibly a password.
      
      In addition, the README should now properly direct users on how to use the latest version of the library.
      0131fe43
  7. 01 May, 2019 7 commits
    • Nathan Harris's avatar
    • Nathan Harris's avatar
      Merge pull request #36 from Mordil/resolve-batching · d071bbae
      Nathan Harris authored
      Resolve `RedisPipeline` Proposal Discussion Topic
      d071bbae
    • Nathan Harris's avatar
      Resolve `RedisPipeline` Proposal Discussion Topic · 066a5c3d
      Nathan Harris authored
      Motivation:
      
      During the discussion thread of the NIORedis SSWG proposal, there were concerns expressed over the implementation
      of `RedisPipeline` that covered the following areas:
      
      1. Clashes with SwiftNIO concepts such as "Pipeline"
      2. Misleading users on library behavior with using a Pipeline vs. a single `RedisConnection`
      3. The implementation was "too clever" in that it allowed users to easily find themselves in "Undefined Behavior"
         due to lack of enough type safety in the API
      
      However, the value in being able to control how frequently "flush" happens on a socket was discussed and considered
      high - so something still needs to be in place to force flushes by users.
      
      It was decided to leave the implementation of batching commands and their responses to library users, perhaps in
      higher level frameworks while the library will provide said mechanism for controlling writing and flushing of commands.
      
      Modifications:
      
      - Add: `sendCommandsImmediately` bool property to `RedisConnection` to handle choice of flushing after each command
      - Remove: `RedisPipeline`
      
      Results:
      
      Users should now have a more clear understanding on what type of control they have over the timing of when commands
      are actually sent over the wire, with the greater emphasis placed on `RedisConnection`.
      066a5c3d
    • Nathan Harris's avatar
      Merge pull request #39 from Mordil/cleanup-handlers · 8bde6fd4
      Nathan Harris authored
      Simplify RESP Parsing and Redis Channel Handlers
      8bde6fd4
    • Nathan Harris's avatar
      Simplify RESP Parsing and Redis Channel Handlers · 477668e6
      Nathan Harris authored
      Motivation:
      
      As it stands, the parsing / encoding implementations for RESP was directly tied to the NIO Channel Handlers.
      
      Unit tests were sloppily spread across multiple files and it made it difficult to explicitly separate out
      the Channel Handler behavior from the RESP specification implementation.
      
      Modifications:
      
      - Add: `RESPTranslator` enum helper object with static methods that only handles RESP parsing / encoding
      - Rename: `RESPEncoder` to `RedisMessageEncoder`
      - Rename: `RESPDecoder` to `RedisByteDecoder`
      
      Results:
      
      It should be easier to understand what type is intended to be used as part of a NIO channel pipeline while
      still having a direct way of parsing / encoding between Swift types and the RESP specification.
      
      Unit tests should be more maintainable as well.
      477668e6
    • Nathan Harris's avatar
      Merge pull request #38 from Mordil/namespacing · a8a1fa59
      Nathan Harris authored
      Namespace global static factory methods under `Redis`
      a8a1fa59
    • Nathan Harris's avatar
      Namespace global static factory methods under `Redis` · e446a834
      Nathan Harris authored
      Motivation:
      
      The two provided factory methods for creating `RedisConnection` and `ClientBootstrap` were not readily discoverable or appropriately expressible.
      
      Modifications:
      
      - Add: `Redis` top-level namespace enum
      - Move & Rename: `RedisConnection.connect` factory method to `Redis.makeConnection`
      - Move & Rename: `ClientBootstrap.makeRedisDefault` factory method to `Redis.makeDefaultClientBootstrap`
      - Rename: `EventLoopFuture` extension file to just `SwiftNIO` to have all framework extensions in a single file
      
      Results:
      
      Using NIORedis should be more discoverable and straight forward on how to create a connection with `Redis.makeConnection(...)` over `RedisConnection.connect(...)`
      e446a834
  8. 30 Apr, 2019 2 commits
    • Nathan Harris's avatar
      Merge pull request #37 from Mordil/error-handling · d03823f2
      Nathan Harris authored
      Standardize Error Handling
      d03823f2
    • Nathan Harris's avatar
      Standardize Error Handling · 46e96bd9
      Nathan Harris authored
      Motivation:
      
      `RedisError` was being used in many places in an ad-hoc fashion that made it unclear as to what source of errors it exactly represents.
      
      In addition, it doesn't follow community conventions of handling known "classes" of errors with enums rather than static struct instances.
      
      Results:
      
      All errors that are generated and thrown within the library are specified as either `RESPDecoder.Error` or `NIORedisError`.
      
      `RedisError` is simplified to represent an error message sent by a Redis instance that conforms to `LocalizedError`.
      46e96bd9
  9. 24 Apr, 2019 3 commits
  10. 10 Apr, 2019 1 commit
  11. 09 Apr, 2019 4 commits
  12. 01 Apr, 2019 2 commits
  13. 29 Mar, 2019 1 commit
  14. 28 Mar, 2019 6 commits
    • Nathan Harris's avatar
      Merge pull request #27 from Mordil/remove-authorize · 0797c3f4
      Nathan Harris authored
      Remove `authorize` convenience command method
      0797c3f4
    • Nathan Harris's avatar
      Remove `authorize` convenience command method · 2b7b2130
      Nathan Harris authored
      Motivation:
      
      As this command is embedded in the creation of a `RedisConnection` and you authorize an entire connection to a Redis instance - this command serves no purpose and could make it easier for users to shoot themselves in the foot.
      
      Results:
      
      `authorize(with:)` convenience method is removed, and the `RedisConnection.connect` method now sends a raw command
      2b7b2130
    • Nathan Harris's avatar
      Merge pull request #25 from Mordil/remove-driver · 152eb30f
      Nathan Harris authored
      Remove `RedisDriver`
      152eb30f
    • Nathan Harris's avatar
      Remove `RedisDriver` · db4a156d
      Nathan Harris authored
      Motivation:
      
      `RedisDriver` has one of the weakest use cases for existence, as its entire purpose can be solved with a static function on `RedisConnection`.
      
      Result:
      
      `RedisDriver` no longer is a thing, and a simpler process of creating a `RedisConnection` is available through the static method `connect(to:with:on:logger:)`.
      
      Also, the `ClientBootstrap.makeForRedis(using:)` method has been cleaned up and renamed to `ClientBootstrap.makeRedisDefault(using:)`.
      db4a156d
    • Nathan Harris's avatar
      Merge pull request #26 from Mordil/redis-pipeline · ba6bf6d8
      Nathan Harris authored
      Simplify `RedisPipeline`
      ba6bf6d8
    • Nathan Harris's avatar
      Simplify `RedisPipeline` · c4ea8f9e
      Nathan Harris authored
      Motivation:
      
      `RedisPipeline` has a weak use case as a protocol, as it is more than likely 98% of use cases will end up using the `NIORedisPipeline` implementation.
      
      Result:
      
      `RedisPipeline` is more direct in its intended usage, with comment blocks being more clear.
      c4ea8f9e