Home

Awesome

Polly-Samples

Polly logo

This repository provides sample implementations of using the Polly library in a .NET application.

The intent of this project is to help newcomers kick-start the use of Polly within their own projects.

The samples demonstrate the policies in action, against faulting endpoints.

Projects

The solution contains three applications and one class library:

flowchart LR
    console{{PollyTestClientConsole}}
    wpf{{PollyTestClientWPF}}
    lib>PollyDemos]
    api[/PollyTestWebApi\]

    console -- uses --> lib
    wpf -- uses --> lib
    lib -- invokes --> api

Demos

General information

Sequence

#DescriptionLink
00No strategyCode
01Retry N timesCode
02Wait and retry N timesCode
03Wait and retry N times, N big enough to guarantee successCode
04Wait and retry foreverCode
05Wait and retry with exponential back-offCode
06Wait and retry nesting circuit breakerCode
07Wait and retry chaining with circuit breaker by using PipelineCode
08Fallback, Retry, and CircuitBreaker in a PipelineCode
09Fallback, Timeout, and Retry in a PipelineCode
10Without isolation: Faulting calls swamp resources, <br/>also prevent good callsCode
11With isolation: Faulting calls separated, <br/>do not swamp resources, good calls still succeedCode
12Hedging in latency modeCode
13Hedging in fallback mode: retry onlyCode
14Hedging in fallback mode: retry with fallbackCode
15Hedging in parallel modeCode
16Entity Framework with retry N timesCode

Want further information?

Slide decks

View the slides presented at NDC, DevIntersections and other conferences.

You are welcome to use and adapt this presentation for not-for-profit presentations of Polly to co-workers, user groups and similar, subject to the condition that references to the .NET Foundation, App-vNext and the individual members of the Polly team are retained.