<commit_before># FaultTolerance

A set of classes that helps to setup fault-tolerant applications in PHP.

**This is an early draft and is not supposed to be used as it now, I may break things :)**

- [Operations](#operations)
- [Operation Runners](#operation-runners)

## Operation

An operation is an atomic piece of processing. This is for instance an API call to an third-party service.
You can defines an operation by using the callback method, like this:

```php
use FaultTolerance\Operation\Callback;

$operation = new Callback(function() use ($client) {
    return $client->get('/foo');
});
```

## Operation runners

In order to run the different applications, you can use and combine different operation runners. The list bellow
describes the different operation runners available:

- [`SimpleOperationRunner`](#simpleoperationrunner) that simply calls the operation

### SimpleOperationRunner

That's the simplest operation runner ever. It calls `run()` on the operation.

```php
use FaultTolerance\OperationRunner\SimpleOperationRunner;
<commit_msg>The alert message should be visible<commit_after># FaultTolerance

**This is an early draft and is not supposed to be used as it now, I may break things :)**

A set of classes that helps to setup fault-tolerant applications in PHP.

- [Operations](#operations)
- [Operation Runners](#operation-runners)

## Operation

An operation is an atomic piece of processing. This is for instance an API call to an third-party service.
You can defines an operation by using the callback method, like this:

```php
use FaultTolerance\Operation\Callback;

$operation = new Callback(function() use ($client) {
    return $client->get('/foo');
});
```

## Operation runners

In order to run the different applications, you can use and combine different operation runners. The list bellow
describes the different operation runners available:

- [`SimpleOperationRunner`](#simpleoperationrunner) that simply calls the operation

### SimpleOperationRunner

That's the simplest operation runner ever. It calls `run()` on the operation.

```php
use FaultTolerance\OperationRunner\SimpleOperationRunner;

{'fraction_non_alphanumeric': 0.08582089552238806, 'fraction_numerical': 0.0, 'mean_word_length': 5.128571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6139023', 'n_tokens_mistral': 570, 'n_tokens_neox': 537, 'n_words': 257}