Skip to content

RetryAttempt and static lambdas in V8 (Zero heap allocation) #2416

Discussion options

You must be logged in to vote

You can do something like this:

public sealed class SamanKishHttpClient(HttpClient httpClient, IOptions<SamanKishOptions> options, ResiliencePipelineProvider<string> resiliencePipelineProvider, MeterRegistry meterRegistry) : ISamanKishHttpClient
{
    public async Task<ApiCallResult<SamanKishTransactionAckResponseDto?>> VerifyTransactionAsync(SamanKishTransactionAckRequestDto request)
    {
        var context = ResilienceContextPool.Shared.Get();
        context.Properties.Set(PollyResilienceKeys.RETRY_COUNT, 0);
        var pipeline = resiliencePipelineProvider.GetPipeline<ApiCallResult<SamanKishTransactionAckResponseDto?>>(Constants.SAMANKISH_RETRY_VERIFY);
        try
        {
-

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ArminShoeibi
Comment options

@martincostello
Comment options

Answer selected by ArminShoeibi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants