Repository navigation
v3.0.0-rc.4
Pre-release
Pre-release
·
17 commits
to master
since this release
ModernDiskQueue v3.0.0-rc.4
✨Highlights
This release is all about improving support for serialization strategies
- For typed queues, you can now select from two built-in serializers - the new JSON serializer using
System.Text.Json.JsonSerializeror the original XML serializer based onSystem.Runtime.Serialization.DataContractSerializer. - It's easier to specify your default serialization strategy:
- At queue-creation, a default serialization strategy can be specified which will be used by all sessions created for that queue.
- At session-creation, the strategy can be passed in via the
.OpenSessionAsyncoverloads. - Built-in strategies can be specified using their
ISerializationStrategy<T>implementations,SerializationStrategyXml<T>andSerializationStrategyJson<T>, or with a new enum,SerializationStrategy.XmlandSerializationStrategy.Json.
- The XML serializer remains the default for backward compatibility.
- New projects should strongly consider using the JSON serializer.
- The JSON serializer produces significantly smaller data files on disk.
- Source-generated serialization can be used. It's easy and results in significantly better performance than reflection-based serialization.
- Implementation of
ISerializationStrategy<T>can be made easier by inheriting from either of two base classes,SyncSerializationStrategyBaseorAsyncSerializationStrategyBase. - Significant build-out of the README.md file to include expanded examples and ** more comprehensive documentation**.
- Expanded test coverage: Added unit tests for all new features and behaviors with serialization strategies.
- Benchmarking project: Includes a new benchmark to compare data file size on disk when using different
ISerializationStrategy<T>implementations.
✌️ Compatibility
- The original synchronous API is fully preserved from DiskQueue, allowing drop-in replacement for most scenarios, with the following migration caveats:
- If you have custom implementations of
ISerializationStrategy<T>, change them to inherit fromSyncSerializationStrategyBase. - If you are using the implementation interfaces (
IFileDriver,IBinaryReader, etc), include the new namespace in your using statements. The implementation interfaces have been moved to theModernDiskQueue.Implementation.Interfacesnamespace. - If you directly reference
DefaultSerializationStrategy<T>, this class has been replaced withSerializationStrategyXml<T>. - These transition requirements are documented in the Migrating from DiskQueue section of the README file.
- If you have custom implementations of
Note: Do not invoke async and sync API usage on the same queue objects.
⚠️ Breaking Changes from v2
- Namespaces for the built-in default serialization strategy and
ISerializationStrategy<T>have changed. - Namespace for the registration helper has moved from
ModernDiskQueue.DependencyInjectionto the root namespace,ModernDiskQueue. - Advanced Scenarios: Namespaces have been made more consistent for internal interfaces.
For migration guidance, usage examples, and more details on the async API, see the README file.
