1. 20 Feb, 2020 3 commits
  2. 18 Feb, 2020 1 commit
  3. 05 Feb, 2020 3 commits
  4. 26 Jan, 2020 2 commits
  5. 16 Jan, 2020 2 commits
  6. 31 Dec, 2019 3 commits
    • Nathan Harris's avatar
      Merge branch 'range-api' into 'master' · 6e45f56e
      Nathan Harris authored
      Rework SortedSet and List range APIs
      
      See merge request Mordil/swift-redi-stack!98
      6e45f56e
    • Nathan Harris's avatar
      Rework SortedSet and List range APIs · 24999985
      Nathan Harris authored
      Motivation:
      
      The SortedSet and List range commands (LTRIM, LRANGE, ZRANGE, etc.) are stringly-based and not flexible with Swift syntax.
      
      Modifications:
      
      - Add overloads of LTRIM that support the gambit of Range Standard Library types
      - Rework LRANGE to mirror LTRIM method signatures
      - Rework ZScore Range based commands to be more type-safe with `RedisZScoreBound` enum
      - Rework ZLex Range based commands to be more type-safe with `RedisZLexBound` enum
      - Rework ZCOUNT, ZLEXCOUNT, ZRANGE, ZREVRANGE, ZREMRANGEBYLEX, ZREMRANGEBYRANK, ZREMRANGEBYSCORE methods to be more type-safe and support Swift Range syntax
      
      Result:
      
      Working with SortedSet ranges should be much more type safe, and expressive with Swift's Range syntax.
      24999985
    • Nathan Harris's avatar
      Update Linux test manifest · 47480b80
      Nathan Harris authored
      47480b80
  7. 28 Dec, 2019 8 commits
    • Nathan Harris's avatar
      Merge branch 'revisit-zadd' into 'master' · 346d37d6
      Nathan Harris authored
      Revisit the SortedSet `zadd` command API
      
      See merge request Mordil/swift-redi-stack!97
      346d37d6
    • Nathan Harris's avatar
      Revisit the SortedSet `zadd` command API · 8e3d8f6f
      Nathan Harris authored
      Motivation:
      
      While reviewing the API, the current design does not read well, and still has room for misunderstanding the actual end result of a ZADD operation.
      
      Modifications:
      
      - Rename `RedisSortedSetAddOption` to `RedisZaddInsertBehavior` and update cases to match desired use site syntax.
      - Add `RedisZaddReturnBehavior` enum to define how `zadd` should calculate the return value.
      - Update `zadd` and its overloads to support the two new enums in the form of `zadd(_:to:inserting:returning:)`
      
      Result:
      
      The more "Swifty" API will make it much more clear to developers at the call site what the actual behavior of the ZADD command will be.
      8e3d8f6f
    • Nathan Harris's avatar
      Merge branch 'blocking-timeamount' into 'master' · 4350e010
      Nathan Harris authored
      Use `TimeAmount` for any `timeout` command arguments
      
      See merge request Mordil/swift-redi-stack!96
      4350e010
    • Nathan Harris's avatar
      Use `TimeAmount` for any `timeout` command arguments · 1ef315e2
      Nathan Harris authored
      Motivation:
      
      The goal is to have a strong-typed API for type-safety in arbitrary values, such as trying to use
      Int to represent time - as '3' could mean any unit of time, leaving many places for errors and bugs.
      
      Modifications:
      
      Switch all current APIs that accept a `timeout` argument to use `NIO.TimeAmount` instead of a plain `Int`.
      
      Result:
      
      Developers will have an easier time reasoning about their own code as to what values might mean when working with
      timeouts in Redis APIs.
      1ef315e2
    • Nathan Harris's avatar
      Merge branch 'isconnected-req' into 'master' · 0007a086
      Nathan Harris authored
      Add `isConnected` property to `RedisClient` protocol
      
      See merge request Mordil/swift-redi-stack!95
      0007a086
    • Nathan Harris's avatar
      Add `isConnected` property to `RedisClient` protocol · a50a4d55
      Nathan Harris authored
      Motivation:
      
      It it pretty common as a developer when working with connections and "database" clients to want to know
      if the connection is currently open before doing any work.
      
      Modifications:
      
      Add `var isConnected: Bool { get }` requirement to the `RedisClient` protocol
      
      Result:
      
      Developers should now have access to the connectivity state of any `RedisClient`
      a50a4d55
    • Nathan Harris's avatar
      Merge branch 'typed-keys' into 'master' · a5f9d76c
      Nathan Harris authored
      Add type-safe representation of Redis keys
      
      See merge request Mordil/swift-redi-stack!93
      a5f9d76c
    • Nathan Harris's avatar
      Add type-safe representation of Redis keys · ea6f4279
      Nathan Harris authored
      Motivation:
      
      Inspired by Swift by Sundell's article on type-safe identifers, the goal of this commit is to have the compiler
      assist in preventing incorrect Redis key values from being used in API calls.
      
      See https://www.swiftbysundell.com/articles/type-safe-identifiers-in-swift/ for the inspiration.
      
      Modifications:
      
      - Add new `RedisKey` struct that wraps around a single `String` value that conforms to several expected protocols
        (Hashable, Comparable, Codable, etc.)
      - Change all command APIs to require `RedisKey` rather than plain strings
      
      Result:
      
      When encountering an API requiring a RedisKey, it should be much more apparant at the use site what form a value should take.
      ea6f4279
  8. 25 Dec, 2019 2 commits
    • Nathan Harris's avatar
      Merge branch 'authorize' into 'master' · 5d6c3d3f
      Nathan Harris authored
      Add authorize command
      
      See merge request Mordil/swift-redi-stack!94
      5d6c3d3f
    • Nathan Harris's avatar
      Add authorize command · 435cdb2a
      Nathan Harris authored
      Motivation:
      
      The library provides command implementations for almost every single Redis command, authorize is no different.
      
      Modifications:
      
      Add `authorize(with:)` command method on `RedisClient`
      Replace the implementation in `RedisConnection.connect(...)`
      
      Result:
      
      Developers should now have independent access to the `AUTH` Redis command on `RedisClient` implementations.
      435cdb2a
  9. 16 Dec, 2019 1 commit
  10. 13 Dec, 2019 2 commits
    • Nathan Harris's avatar
      Merge branch 'custom-logging' into 'master' · 9747cf2e
      Nathan Harris authored
      Revist user Logging configuration for connections and clients
      
      See merge request Mordil/swift-redi-stack!92
      9747cf2e
    • Nathan Harris's avatar
      Revisit user Logging configuration for connections and clients · 209ba87b
      Nathan Harris authored
      Motivation:
      
      Logging is more dynamic in real world usage than the current static heavy API allows.
      
      Users generally want to be capable of updating connection logger metadata to attach dynamic properties such as an HTTP request ID for log tracing.
      
      Modifications:
      
      - Move all logs to `RedisConnection`
      - Add `id: UUID` property to `RedisConnection`
      - Add `logging` property and `setLogging(to:)` method requirements to `RedisClient`
      - Add chainable `logging(to:)` method extension to `RedisClient`
      - Add additional `trace` log statements to `RedisConnection`
      - Change when `RedisConnection.init` logging and metric calls are made
      - Change some `debug` log statements to `trace in `RedisConnection`
      
      Result:
      
      Users should have infinitely more flexibility in how RedisConnection, and RedisClient  implementations in general, behave in regards to logging.
      209ba87b
  11. 27 Oct, 2019 5 commits
    • Nathan Harris's avatar
      Merge branch 'variadic-overloads' into 'master' · e0ebf926
      Nathan Harris authored
      Add variadic overloads for several commands
      
      See merge request Mordil/swift-redi-stack!87
      e0ebf926
    • Nathan Harris's avatar
      Add variadic overloads for several commands · adcff650
      Nathan Harris authored
      Motivation:
      
      For ergonomics, users sometimes want to provide arguments as a variadic list rather than an array.
      
      Modifications:
      
      - Add variadic overloads for almost all methods that accept lists of homogenous types
      
      Result:
      
      Users should have more flexibility in the way arguments are passed to command methods
      adcff650
    • Nathan Harris's avatar
      Merge branch 'generic-get' into 'master' · 8ce1dd82
      Nathan Harris authored
      Add RedisClient.get generic overload
      
      See merge request Mordil/swift-redi-stack!86
      8ce1dd82
    • Nathan Harris's avatar
      Add RedisClient.get generic overload · 9e5179f3
      Nathan Harris authored
      Motivation:
      
      It is wrong to always assume that a GET operation is expecting a String response type, as users may be storing other types of data.
      
      Modifications:
      
      - Add `get` generic method with a constraint for types of `RESPValueConvertible` to convert values to the user desired type
      - Change existing `get` method to specialize the generic overload
      - Fix incorrect doc block regarding the ELF failure condition
      
      Result:
      
      Users should now be able to specialize the return type of a "GET" command
      9e5179f3
    • Nathan Harris's avatar
      Add dev Docker Compose file · 5c39c836
      Nathan Harris authored
      5c39c836
  12. 07 Oct, 2019 2 commits
    • Nathan Harris's avatar
      Merge branch 'remove-assertions' into 'master' · a3f6d3b8
      Nathan Harris authored
      Remove unnecessary assertions in `RedisCommandHandler`
      
      See merge request Mordil/swift-redi-stack!85
      a3f6d3b8
    • Nathan Harris's avatar
      Remove unnecessary assertions in `RedisCommandHandler` · ba66ebf8
      Nathan Harris authored
      Motivation:
      
      The assertions in `errorCaught(context:error:)` and `channelRead(context:data:)` are holdovers from when SwiftLog was not integrated into the package. The conditions where they were triggered are safely handled in other ways, so the asserts are not guarding against undefined behavior or bad app state.
      
      Modifications:
      
      Remove the two asserts regarding the `RedisCommandHandler.commandResponseQueue` to rely on Logging to bubble up errors to the user.
      
      Result:
      
      Debug builds using RediStack should not encounter unexpected assertions and should rely on other, better, error handling.
      
      This contributes to issue #65
      ba66ebf8
  13. 24 Sep, 2019 5 commits
    • Nathan Harris's avatar
      Merge branch 'thread-sanitizer' into 'master' · 237f049c
      Nathan Harris authored
      Run thread sanitizer on 5.1 test CI jobs
      
      See merge request Mordil/swift-redi-stack!84
      237f049c
    • 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
    • Nathan Harris's avatar
      Run thread sanitizer on 5.1 test CI jobs · dfca5704
      Nathan Harris authored
      Motivation:
      
      Now that SwiftPM with 5.1 supports Linux thread sanitizers, we should run this as part of the normal test pass to catch threading issues.
      
      Modifications:
      
      Add `--sanitize=thread` argument to `swift test` commands for any job that runs Swift >=5.1.
      
      Result:
      
      More bugs should be caught as soon as possible now that thread races are being monitored.
      dfca5704
    • Nathan Harris's avatar
      Merge branch 'update-test-matrix' into 'master' · 2a27a598
      Nathan Harris authored
      Update Test Matrix to include Swift 5.1 Official Release
      
      See merge request Mordil/swift-redi-stack!83
      2a27a598
    • Nathan Harris's avatar
      Update Test Matrix to include Swift 5.1 Official Release · 3c4b5c40
      Nathan Harris authored
      Motivation:
      
      With the release of Swift 5.1, the official docker containers are available for both 16.04 and 18.04 of Linux - so the test matrix should include them.
      
      Modifications:
      
      - Add new 5.1 jobs for 18.04 linux and change 16.04 5.1 jobs to use the official docker images.
      - Update the README to capture the changes
      
      Result:
      
      The number of configurations the library is tested against should be as wide as possible for regular interval testing passes.
      3c4b5c40
  14. 29 Jul, 2019 1 commit