• Nathan Harris's avatar
    Revisit the SortedSet `zadd` command API · 8e3d8f6f
    Nathan Harris authored
    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.
    - 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:)`
    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.
SortedSetCommands.swift 39.1 KB