This addresses some semantic issues with the original implementation of SessionDriver for Redis in #175.
Two important changes were made to RedisSessionsDelegate:
makeNewID does not prefix the ID with vrs- anymore
A new makeKey(for:) optional method has been added to the protocol to convert an ID to a RediStack.RedisKey to customize how the id is represented as a key.
The default implementation adds the vrs- prefix.
In addition, the protocol has seen two quality of life (breaking) changes to the required protocol methods:
Their argument labels have been updated to read a bit nicer at call sites, and the RedisKey is now passed instead of a SessionID
They have been marked @inlinable in the protocol definition. To take advantage of potential inlining, make sure you also mark your conformances with @inlinable.
This addresses some semantic issues with the original implementation of
SessionDriver
for Redis in #175.Two important changes were made to
RedisSessionsDelegate
:makeNewID
does not prefix the ID withvrs-
anymoremakeKey(for:)
optional method has been added to the protocol to convert an ID to aRediStack.RedisKey
to customize how the id is represented as a key.vrs-
prefix.In addition, the protocol has seen two quality of life (breaking) changes to the required protocol methods:
RedisKey
is now passed instead of aSessionID
redis(_:storeData:forID:)
->redis(_:store:with:)
redis(_:fetchDataForID:)
->redis(_:fetchDataFor:)
@inlinable
in the protocol definition. To take advantage of potential inlining, make sure you also mark your conformances with@inlinable
.