Merge pull request #6554 from elsa-workflows/rc/36595_compression
Moved compression to separate feature
This commit is contained in:
commit
d1cee77fd2
|
|
@ -2,6 +2,7 @@ using System.Text.Encodings.Web;
|
|||
using Elsa.Alterations.Extensions;
|
||||
using Elsa.Alterations.MassTransit.Extensions;
|
||||
using Elsa.Caching.Options;
|
||||
using Elsa.Common.Codecs;
|
||||
using Elsa.Common.DistributedHosting.DistributedLocks;
|
||||
using Elsa.Common.RecurringTasks;
|
||||
using Elsa.Common.Serialization;
|
||||
|
|
@ -51,7 +52,6 @@ using Elsa.Workflows.CommitStates.Strategies;
|
|||
using Elsa.Workflows.IncidentStrategies;
|
||||
using Elsa.Workflows.LogPersistence;
|
||||
using Elsa.Workflows.Management;
|
||||
using Elsa.Workflows.Management.Compression;
|
||||
using Elsa.Workflows.Management.Stores;
|
||||
using Elsa.Workflows.Memory;
|
||||
using Elsa.Workflows.Options;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
|
||||
namespace Elsa.Workflows.Management.Compression;
|
||||
namespace Elsa.Common.Codecs;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a GZip compression strategy.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elsa.Workflows.Management.Compression;
|
||||
namespace Elsa.Common.Codecs;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a compression strategy that does not compress or decompress the input.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using System.Text;
|
||||
using IronCompress;
|
||||
|
||||
namespace Elsa.Workflows.Management.Compression;
|
||||
namespace Elsa.Common.Codecs;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a ZSTD compression strategy.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elsa.Workflows.Management;
|
||||
namespace Elsa.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a compression strategy.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Elsa.Workflows.Management;
|
||||
namespace Elsa.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Resolves a <see cref="ICompressionCodec"/> from its name.
|
||||
|
|
@ -16,6 +16,7 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Cronos" />
|
||||
<PackageReference Include="DistributedLock.Core" />
|
||||
<PackageReference Include="IronCompress" />
|
||||
<PackageReference Include="LinqKit.Core" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
|
||||
|
|
|
|||
21
src/modules/Elsa.Common/Features/CompressionFeature.cs
Normal file
21
src/modules/Elsa.Common/Features/CompressionFeature.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using Elsa.Common.Codecs;
|
||||
using Elsa.Common.Services;
|
||||
using Elsa.Features.Abstractions;
|
||||
using Elsa.Features.Services;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Elsa.Common.Features;
|
||||
|
||||
[UsedImplicitly]
|
||||
public class CompressionFeature(IModule module) : FeatureBase(module)
|
||||
{
|
||||
public override void Apply()
|
||||
{
|
||||
Services
|
||||
.AddSingleton<ICompressionCodecResolver, CompressionCodecResolver>()
|
||||
.AddSingleton<ICompressionCodec, None>()
|
||||
.AddSingleton<ICompressionCodec, GZip>()
|
||||
.AddSingleton<ICompressionCodec, Zstd>();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using Elsa.Workflows.Management.Compression;
|
||||
using Elsa.Common.Codecs;
|
||||
|
||||
namespace Elsa.Workflows.Management.Services;
|
||||
namespace Elsa.Common.Services;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class CompressionCodecResolver : ICompressionCodecResolver
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using Elsa.Common;
|
||||
using Elsa.Common.Codecs;
|
||||
using Elsa.Common.Entities;
|
||||
using Elsa.Common.Models;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Workflows;
|
||||
using Elsa.Workflows.Management;
|
||||
using Elsa.Workflows.Management.Compression;
|
||||
using Elsa.Workflows.Management.Entities;
|
||||
using Elsa.Workflows.Management.Filters;
|
||||
using Elsa.Workflows.Management.Models;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
using Elsa.Common;
|
||||
using Elsa.Common.Codecs;
|
||||
using Elsa.Extensions;
|
||||
using Elsa.Workflows;
|
||||
using Elsa.Workflows.Management;
|
||||
using Elsa.Workflows.Management.Compression;
|
||||
using Elsa.Workflows.Management.Options;
|
||||
using Elsa.Workflows.Runtime;
|
||||
using Elsa.Workflows.Runtime.Entities;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Reflection;
|
|||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Elsa.Caching.Features;
|
||||
using Elsa.Common.Codecs;
|
||||
using Elsa.Common.Features;
|
||||
using Elsa.Expressions.Contracts;
|
||||
using Elsa.Extensions;
|
||||
|
|
@ -14,10 +15,8 @@ using Elsa.Features.Services;
|
|||
using Elsa.Workflows.Features;
|
||||
using Elsa.Workflows.LogPersistence;
|
||||
using Elsa.Workflows.Management.Activities.WorkflowDefinitionActivity;
|
||||
using Elsa.Workflows.Management.Compression;
|
||||
using Elsa.Workflows.Management.Contracts;
|
||||
using Elsa.Workflows.Management.Entities;
|
||||
using Elsa.Workflows.Management.Handlers;
|
||||
using Elsa.Workflows.Management.Handlers.Notifications;
|
||||
using Elsa.Workflows.Management.Mappers;
|
||||
using Elsa.Workflows.Management.Materializers;
|
||||
|
|
@ -35,9 +34,10 @@ namespace Elsa.Workflows.Management.Features;
|
|||
/// <summary>
|
||||
/// Installs and configures the workflow management feature.
|
||||
/// </summary>
|
||||
[DependsOn(typeof(CompressionFeature))]
|
||||
[DependsOn(typeof(MediatorFeature))]
|
||||
[DependsOn(typeof(SystemClockFeature))]
|
||||
[DependsOn(typeof(MemoryCacheFeature))]
|
||||
[DependsOn(typeof(SystemClockFeature))]
|
||||
[DependsOn(typeof(WorkflowsFeature))]
|
||||
[DependsOn(typeof(WorkflowDefinitionsFeature))]
|
||||
[DependsOn(typeof(WorkflowInstancesFeature))]
|
||||
|
|
@ -234,10 +234,6 @@ public class WorkflowManagementFeature(IModule module) : FeatureBase(module)
|
|||
.AddScoped<WorkflowDefinitionMapper>()
|
||||
.AddSingleton<VariableDefinitionMapper>()
|
||||
.AddSingleton<WorkflowStateMapper>()
|
||||
.AddSingleton<ICompressionCodecResolver, CompressionCodecResolver>()
|
||||
.AddSingleton<ICompressionCodec, None>()
|
||||
.AddSingleton<ICompressionCodec, GZip>()
|
||||
.AddSingleton<ICompressionCodec, Zstd>()
|
||||
;
|
||||
|
||||
Services
|
||||
|
|
|
|||
Loading…
Reference in a new issue