Add void Process(CancellationToken) method -- allows the caller to cancel the operation.
Correspondingly update FlowData class -- Process() now forwards to Process(CancellationToken) successor implementation.
Add CancellationToken ProcessingCancellationToken { get; } property -- exposes the provided [CancellationToken] to pipeline and flow elements.
Pipeline.Process(IFlowData) and FlowData.Process(CancellationToken) now respect ProcessingCancellationToken and can throw [OperationCanceledException].
Update Web integrations:
WebPipeline (for ASP.NET Framework) passes the tokens from [HttpContextBase] for IFlowData.Process:
Add constructors that accept responseHeaders in IReadOnlyDictionary<string, string> form -- as returned by ResponseHeaders property -- to allow re-constructing the exception from AggregateException's inner cause.
Move default value (empty dictionary) for ResponseHeaders from constructors lacking this parameter to the getter -- return non-null even if constructor is called with explicitly null responseHeaders parameter.
Update EvidenceKeyFilterWhitelist:
Add constructors that accept inclusionList as IEnumerable<string> rather than List<string> (or IReadOnlyDictionary<string, int> rather than Dictionary<string, int>) -- as they are never mutated and don't need to depend on specific container implementation.
🚧 Expands on https://github.com/51Degrees/pipeline-dotnet/pull/134
For the content delta see:
Changes
TaskWaitingCancellation/TaskExtensions
static class -- providesTask<T> WithCancellation<T>(this Task<T>, CancellationToken)
extension method:AsyncLazyFailable
:Task<TResult> GetValueAsync(CancellationToken)
method.AggregateException
).CloudRequestEngine
:AsyncLazyFailable
.EvidenceKeyFilter
,PublicProperties
) at constructor time.IFlowData.ProcessingCancellationToken
to [HttpClient.SendAsync].IFlowData
interface:void Process(CancellationToken)
method -- allows the caller to cancel the operation.FlowData
class --Process()
now forwards toProcess(CancellationToken)
successor implementation.CancellationToken ProcessingCancellationToken { get; }
property -- exposes the provided [CancellationToken] to pipeline and flow elements.Pipeline.Process(IFlowData)
andFlowData.Process(CancellationToken)
now respectProcessingCancellationToken
and can throw [OperationCanceledException].WebPipeline
(for ASP.NET Framework) passes the tokens from [HttpContextBase] forIFlowData.Process
:PipelineResultService
(for ASP.NET Core) passes [HttpContext.RequestAborted] toIFlowData.Process
.CloudRequestException
:responseHeaders
inIReadOnlyDictionary<string, string>
form -- as returned byResponseHeaders
property -- to allow re-constructing the exception fromAggregateException
's inner cause.ResponseHeaders
from constructors lacking this parameter to the getter -- return non-null even if constructor is called with explicitly null responseHeaders parameter.EvidenceKeyFilterWhitelist
:inclusionList
asIEnumerable<string>
rather thanList<string>
(orIReadOnlyDictionary<string, int>
rather thanDictionary<string, int>
) -- as they are never mutated and don't need to depend on specific container implementation.EvidenceKeyFilterAggregator
:AsyncLazyFailable
implementation.TaskExtensions.WithCancellation
implementation.CloudRequestEngine
andPipeline
reacting toIFlowData
processing cancellation.Why
Test results
.nupkg
built by 📦 https://github.com/postindustria-tech/pipeline-dotnet/actions/runs/11406530090Screenshots
(new stacktrace)
(unaffected)