| | | 1 | | using Elsa.Features.Abstractions; |
| | | 2 | | using Elsa.Features.Services; |
| | | 3 | | using Elsa.Workflows.Management.Handlers; |
| | | 4 | | using Elsa.Workflows.Management.Handlers.Notifications; |
| | | 5 | | using Elsa.Workflows.Management.Services; |
| | | 6 | | using Elsa.Workflows.Management.Stores; |
| | | 7 | | using Microsoft.Extensions.DependencyInjection; |
| | | 8 | | |
| | | 9 | | namespace Elsa.Workflows.Management.Features; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Configures workflow definition caching. |
| | | 13 | | /// </summary> |
| | | 14 | | public class CachingWorkflowDefinitionsFeature : FeatureBase |
| | | 15 | | { |
| | | 16 | | /// <inheritdoc /> |
| | 1 | 17 | | public CachingWorkflowDefinitionsFeature(IModule module) : base(module) |
| | | 18 | | { |
| | 1 | 19 | | } |
| | | 20 | | |
| | | 21 | | /// <inheritdoc /> |
| | | 22 | | public override void Apply() |
| | | 23 | | { |
| | 1 | 24 | | Services.AddSingleton<IWorkflowDefinitionCacheManager, WorkflowDefinitionCacheManager>(); |
| | 1 | 25 | | Services.Decorate<IWorkflowDefinitionStore, CachingWorkflowDefinitionStore>(); |
| | 1 | 26 | | Services.Decorate<IWorkflowDefinitionService, CachingWorkflowDefinitionService>(); |
| | 1 | 27 | | Services.AddNotificationHandler<EvictWorkflowDefinitionServiceCache>(); |
| | 1 | 28 | | } |
| | | 29 | | } |