Hackmesser.Execution 1.0.0

Execution strategy allow you to handle exceptions easy and compact

Install-Package Hackmesser.Execution -Version 1.0.0
dotnet add package Hackmesser.Execution --version 1.0.0
<PackageReference Include="Hackmesser.Execution" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hackmesser.Execution --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Execution strategy allow you to handle exceptions easy and compact.

Usages

    var objectExecutionStrategy = new ExecutionStrategyBuilder<object>()
        .Wrap(LoadingWrapperAsync)
        .IgnoreOn<OperationCanceledException>()
        .ReturnOn<AppException>(new object())
        .ExecuteOn<Exception>(TrackExceptionAsync)
        .Build();

    var objectOperationResult = await objectExecutionStrategy.ExecuteAsync(DoSomeObjectRequestAsync);

    if (objectOperationResult.IsCompleted)
    {
        var obj = objectOperationResult.Result;
    }

    var executionStrategy = new ExecutionStrategyBuilder()
        .Wrap(LoadingWrapperAsync)
        .IgnoreOn<OperationCanceledException>()
        .RetryOn<Exception>(retryCount:3)
        .Build();

    var operationResult = await executionStrategy.ExecuteAsync(DoSomeRequestAsync);

    if (operationResult.IsFaulted)
    {
        //Do what you need
    }

Execution strategy allow you to handle exceptions easy and compact.

Usages

    var objectExecutionStrategy = new ExecutionStrategyBuilder<object>()
        .Wrap(LoadingWrapperAsync)
        .IgnoreOn<OperationCanceledException>()
        .ReturnOn<AppException>(new object())
        .ExecuteOn<Exception>(TrackExceptionAsync)
        .Build();

    var objectOperationResult = await objectExecutionStrategy.ExecuteAsync(DoSomeObjectRequestAsync);

    if (objectOperationResult.IsCompleted)
    {
        var obj = objectOperationResult.Result;
    }

    var executionStrategy = new ExecutionStrategyBuilder()
        .Wrap(LoadingWrapperAsync)
        .IgnoreOn<OperationCanceledException>()
        .RetryOn<Exception>(retryCount:3)
        .Build();

    var operationResult = await executionStrategy.ExecuteAsync(DoSomeRequestAsync);

    if (operationResult.IsFaulted)
    {
        //Do what you need
    }

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 87 10/24/2020