| | | 1 | | using CShells.Features; |
| | | 2 | | using Elsa.Caching.ShellFeatures; |
| | | 3 | | using Elsa.Workflows.Runtime.Handlers; |
| | | 4 | | using Elsa.Workflows.Runtime.Stores; |
| | | 5 | | using Elsa.Platform.PackageManifest.Generator.Hints; |
| | | 6 | | using JetBrains.Annotations; |
| | | 7 | | using Microsoft.Extensions.DependencyInjection; |
| | | 8 | | |
| | | 9 | | namespace Elsa.Workflows.Runtime.ShellFeatures; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Installs and configures workflow runtime caching features. |
| | | 13 | | /// </summary> |
| | | 14 | | [ManifestFeatureCategory("Workflows")] |
| | | 15 | | [ManifestFeatureCategory("Caching")] |
| | | 16 | | [ShellFeature( |
| | | 17 | | DisplayName = "Caching Workflow Runtime", |
| | | 18 | | Description = "Provides caching for workflow runtime operations", |
| | | 19 | | DependsOn = [typeof(MemoryCacheFeature), typeof(WorkflowRuntimeFeature)])] |
| | | 20 | | [UsedImplicitly] |
| | | 21 | | public class CachingWorkflowRuntimeFeature : IShellFeature |
| | | 22 | | { |
| | | 23 | | public void ConfigureServices(IServiceCollection services) |
| | | 24 | | { |
| | 0 | 25 | | services |
| | 0 | 26 | | // Decorators. |
| | 0 | 27 | | .Decorate<ITriggerStore, CachingTriggerStore>() |
| | 0 | 28 | | |
| | 0 | 29 | | // Handlers. |
| | 0 | 30 | | .AddNotificationHandler<InvalidateTriggersCache>() |
| | 0 | 31 | | .AddNotificationHandler<InvalidateWorkflowsCache>(); |
| | 0 | 32 | | } |
| | | 33 | | } |
| | | 34 | | |
| | | 35 | | |