DSaunders/Bart — pull request #14 by DSaunders (2014-05-07 11:21:17+00:00)
Title: Feature async backoff

**Summary**

This should resolve #1 . It allows you to call ``Bart`` and do work whilst you are waiting for the back-offs in between retries.

Since you can't (I don't think) use ``await`` in an ``Action<>`` (which is what you pass to ``Bart`` to execute) this doesn't yet allow us to do full async, so...

- The back-offs in between are ``async`` but
- The action you pass to ``Bart`` is blocking

It can be called as per this example:

```csharp
await new BartExecutor()
.Run(testAction)
.WithOverrideForException(MockRetrySettings.TwoTimes100ms)
.ExecuteWithAsyncBackoffs();
```

or

```csharp
var executor = new BartExecutor()
.Run(testAction)
.WithOverrideForException(MockRetrySettings.TwoTimes100ms)
.ExecuteWithAsyncBackoffs();

// Do some other work here while we are waiting ...
someWork()

// Now wait until Bart has finished
await executor;
```

This PR includes unit tests for the above, and 2 new integration tests.
- Calling a method using the synchronous version
- Calling a method using the async backoff version

**Unit testing the async backoff**

I have a unit test that calls an action which appends to a ``StringBuilder``. By checking the order that things are added to this string we can determine which order the code was executed in.

(see ``IntegrationTests.cs`` in the ``Tests`` project).

I don't know how else to test that we're releasing back to the caller while backing off, but I'm open to suggestions on how to make the unit test a little nicer.