Skip to content

Refine Redis Command API

Nathan Harris requested to merge cleanup-api into master

Motivation:

It was noticed that many of the commands are cumbersome to use with boilerplate type casting for each use that can be simplified within the library by doing type conversion before returning the value to an end user.

Modifications:

Many APIs that return a RESPValue now have overloads to provide a RESPValueConvertible type that the value will be turned into before being returned.

For a few APIs that returned RESPValue, they did so as an Optional. Those APIs have been changed to always provide a RESPValue and return .null in cases where nil was returned.

In addition, the @inlinable attribute has been removed from any non-generic command API.

Result:

Developers should have less code boilerplate for turning values from RESPValue to their desired type with many commands.

Edited by Nathan Harris

Merge request reports