-
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
.NETPull requests that update .net codePull requests that update .net codeenhancementNew feature or requestNew feature or request
Description
Problem
Module customization is scattered across 6+ marker interfaces (ISkippable, IRetryable, ITimeoutable, IIgnoreFailures, IHookable, IAlwaysRun) instead of a unified configuration approach. This creates:
- Complexity: Each behavior requires implementation
- Consistency Issues: Each behavior has different patterns for configuration
- Discoverability: Hard to find all available module behaviors
- Maintenance: Adding new behaviors requires new interface
Current Design
public class MyModule : Module<string>, ISkippable, IRetryable<string>, ITimeoutable, IIgnoreFailures
{
public bool ShouldSkip(IPipelineContext context) => ...
public IAsyncPolicy<ModuleResult<string?>> GetRetryPolicy() => ...
public TimeSpan? Timeout => ...
public async Task OnBeforeExecuteAsync(IPipelineContext context) => ...
}Proposed Solution
Consolidate into a single builder or configuration interface:
public class MyModule : Module<string>
{
protected override ModuleConfiguration Configure()
{
return ModuleConfiguration.Create()
.WithSkipCondition(ctx => ...)
.WithRetryPolicy(policy)
.WithTimeout(TimeSpan.FromSeconds(30))
.WithErrorHandling(ErrorHandlingStrategy.IgnoreFailures)
.WithHook(HookType.Before, OnBeforeAsync)
.WithAlwaysRun();
}
}Benefits
- Single, consistent configuration point
- Fluent API is more discoverable
- Easier to validate configurations
- Adding new behaviors doesn't require new interfaces
- Better IDE autocomplete experience
Priority: HIGH - Breaking change, high impact on API design
Metadata
Metadata
Assignees
Labels
.NETPull requests that update .net codePull requests that update .net codeenhancementNew feature or requestNew feature or request