# LibTmux.FSharp.Retry.ifNotSent

- **Module:** LibTmux.FSharp
- **Package:** LibTmux.FSharp
- **Language:** F#
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.FSharp/Library.fsi#L146
- **Page:** https://libtmux.org/en/fsharp/latest/reference/libtmux-fsharp-retry-ifnotsent/

```
val ifNotSent:
        cancellationToken: CancellationToken -> retries: int -> operation: (CancellationToken -> Task<'T>) -> Task<'T>
```

Runs an operation, and again up to <c>retries</c> times while nothing it sent reached tmux.

An attempt is repeated only when it fails with <c>NotSent</c> and no
command it sent before that failure reached tmux, counting every command
the operation awaits, including through nested retries. An operation of
several steps whose first step ran is therefore not repeated because a
later step was refused before dispatch. Any other failure, and
cancellation, propagates at once. A read that is safe to repeat whatever
happened belongs in the caller's own retry policy.

## Parameters

- `cancellationToken` (`CancellationToken`)
- `retries` (`int`)
- `operation` (`(CancellationToken -> Task<'T>)`)

## Raises

- [`System.ArgumentOutOfRangeException`](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception): The retry count is negative.
