Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.04 KB

File metadata and controls

41 lines (28 loc) · 1.04 KB

MsgPack

MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves.

Install

PackageManager:

Install-Package StackExchange.Redis.Extensions.MsgPack
dotnet add package StackExchange.Redis.Extensions.MsgPack
<PackageReference Include="StackExchange.Redis.Extensions.MsgPack" Version="5.5.0" />
paket add StackExchange.Redis.Extensions.MsgPack

Setup

Now that you have installed the package, you can register it into your favourite dependency injection framework:

Example using Microsoft.Extensions.DependencyInjection:

services.AddSingleton<ISerializer, MsgPackObjectSerializer>();

Example using Castle.Windsor:

container.Register(Component.For<ISerializer>()
				.ImplementedBy<MsgPackObjectSerializer>()
				.LifestyleSingleton());