1. 30 Sep, 2020 1 commit
    • Nathan Harris's avatar
      Add support for PubSub · e7b597fc
      Nathan Harris authored
      Motivation:
      
      One of the great features of Redis is being able to subscribe and receive messages published to specific channels
      as a way of acting as a message queue for processing jobs.
      
      PubSub requires a specific understanding of the connection model that can only be implemented directly in this library.
      
      Modifications:
      
      - Add: `RedisPubSubHandler` to sit in front of `RedisCommandHandler` to manage subscription callbacks and Redis registration
      - Add: `publish` and the `pubsub` commands
      - Add: `addPubSubHandler` extension to `NIO.Channel`
      - Add: Type-safe String wrapper of `RedisChannelName` for PubSub methods
      - Add: `pubsubSubscriptionNotFound` error case
      - Add: `isSubscribed` property to `RedisConnection`
      - Add: `availableConnectionCount` and `leasedConnectionCount` properties to `RedisConnectionPool`
      - Add: Metrics for PubSub
      - Add: `makeNewPool` factory method to `RedisConnectionPoolIntegrationTestCase`
      - Change: `RedisClient` to require methods for PubSub management, as they are intrinsicly tied to the client's connection model
      - Change: Parsing of `PING` response for handling special case in PubSub mode
      - Rename: `ActiveConnectionGauge` to `RedisMetrics.IncrementalGauge`
      
      Result:
      
      Developers will now be able to use Redis in PubSub mode with both connections and pools.
      
      This resolves #6
      e7b597fc
  2. 20 Apr, 2020 1 commit
  3. 16 Dec, 2019 1 commit
  4. 24 Sep, 2019 1 commit
    • Nathan Harris's avatar
      Fix data race with `RedisMetrics.activeConnectionCount` · 939e41b8
      Nathan Harris authored
      Motivation:
      
      After enabling the thread sanitizer during testing, a data race with the `activeConnectionCount` in `RedisMetrics` was caught due to changing a primitive `Int` across threads.
      
      Modifications:
      
      Add a specialized class `ActiveConnectionGauge` to wrap the semantics of the `activeConnectionCount` with an `Atomic<Int>` property.
      
      Result:
      
      No data races should occur with the `RedisMetrics` subsystem.
      939e41b8
  5. 09 Jul, 2019 1 commit
  6. 06 Jun, 2019 1 commit
    • 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
  7. 05 Jun, 2019 1 commit
    • 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