Skip to content

v13.7.2

Compare
Choose a tag to compare
@AlexFate AlexFate released this 05 Mar 11:22
· 6 commits to master since this release
0f48984

New:

  • Added the ability to connect serializers (now works for Redis) without bringing the dependency into common.
  • Added support for binary serializers in Redis.
  • Added SerializerProvider - gets registered common serializers from DI
  • SerializerFactory is marked obsolete - you should stop using it both inside and outside common.
  • Added interface IBinarySerializer

Requires your attention:

  • enum SerializerType - no longer describes all possible serializer types available in common. (Serializers can be connected via DI and will be available in SerializerProvider/RedisCache)
  • Changed the RedisOptions.Serializer property type from enum SerializerType to string. There is no need to take any action regarding this.
  • The ctor RedisCache and RedisScriptCache have changed - if for some reason you created RedisCache directly through the ctor, use the creation through RedisProvider.

For what:

  • Maybe you want or have been recommended to try some serializer (there are a great many of them) to optimize reading/writing to/from radishes and reduce storage volumes. Now you don't need to make this a dependency for all commands.
  • Reducing the cohesion of namespaces within common for subsequent decomposition

How to add your own serializer for Redis:

  • Create an implementation of the ISerializer or IBinarySerializer interface from the ati.services.common space and place it in a service/separate package/common - think about those who don't need it.
  • Register your serializer like this:
services.AddSingleton<ISerializer, Your implementation>()

or

services.AddSingleton<IBinarySerializer, Your implementation>()
  • Write the name of your serializer in your RedisOptions.Serializer. For example:
       "Keshik": {
         "TimeToLive": "1.00:00:00",
         ...
         "Serializer": "MemoryPack"
       },