Motivation:
Throughout the process of creating and using RESPValue, many unnecessary allocations happened translating ByteBuffers into [Int8] raw byte arrays.
Results:
RESPValue has a more conherent underlying data structure and computed properties, while decoding RESP is more straight forward and performant
Resolves#31
Motivation:
`Foundation.Data` is known to be more expensive than is necessary for this low level of a library, and has some quirks with its usage.
Results:
This library now works with byte arrays (`[UInt8]`) directly, and all references to `Foundation` now explicitly import the exact types they need.
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
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:)`.
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.
Motivation:
`RedisCommandExecutor` was a complex and "wordy" name that was not 100% clear as to how it relates to other types.
`RedisConnection` also has not had a strong use case shown for it to exists as a separate protocol - using up a great name for the "out of the box" implementation.
Result:
`RedisClient` instead of `RedisCommandExecutor` is more clear as to what it is, in Redis terminology, a communication client.
`RedisConnection` as a concrete class provides an identifiable basic block for making connections to Redis.
`RedisConnection` also saw some fixes to `close()` while having some names and comment blocks tweaked for updated naming.
Motivation:
The goal of this commit is to make it easier for library users to implement their own types for creating connections and pipelines without losing all of the convenience command extensions.
This also splits executing commands from the concept of a "connection" to make it more swifty in `RedisPipeline`.
- Move: `String.convertedToData()` to `NIORedisTests` as a test utility
- Change: URLs in code comments to be Markdown links
- Change: Code comments to be more correct
This is to remove the need of allocations with Foundation.Data before writing to the buffer.
We should see an estimated ~10% performance boost to encoding values.