<commit_before># TaskManager
A C++ TaskManager aiming at easily managing asynchronous tasks using the features of the C++11/14

### Requirements
A compiler supporting the C++14 features

### Features
###### Abstractions
* A Task class which is executable, contains std::functions determining it's behaviour
* A Worker, manages the thread and the tasks execution

###### Modules
* A ThreadPool, manages the workers
* A Scheduler, same as the Threadpool, but scheduled ...

### Basic Usage

```C++
using namespace TaskManager;

// Create the ThreadManager with the initial number of threads
ThreadManager manager(1);

// Create the ThreadPool indicating the maximum number of parallel tasks
ThreadPool pool(2, manager);

// Might make it optional in the future
pool.start();

// Add a new task and get it's future
auto future = pool.addTask([](const std::string& ret) { return ret; }, "success");

// Get result from future and print it
std::cout << future.get() << std::endl;

```

In the above example, even if the pool supports 2 parallel tasks, because the assigned manager manages one worker, only one task could be executed at a time.

### Scheduler Usage

```C++

using namespace TaskManager;

// Create the ThreadManager with the initial number of threads
ThreadManager manager(1);

// Create the Scheduler with 1 as the maximum number of parallel tasks
Scheduler scheduler(1, manager);
bool stop = false;

// Create a new task printing the number of elapsed seconds since it's execution
Task task([&stop, &scheduler]() {
    unsigned int i = 1;
    while (!stop) {
        std::this_thread::sleep_for(std::chrono::seconds(1));
        std::cout << std::to_string(i) + " seconds elapsed" << std::endl;
        ++i;
    }
    std::cout << "End of the task" << std::endl;
});

// Set the stopping condition of the task
task.setStopFunction([&stop]() { stop = true; });

// Run the task immediatly
scheduler.runAt(task, std::chrono::steady_clock::now());

// Wait for an event to happen so the scheduler gets detructed and the task gets stopped

```
In the above example it is needed to set a function to stop the task because it runs an infinite loop.
<commit_msg>Update ReadMe to describe the new features.<commit_after># TaskManager
A C++ TaskManager aiming at easily managing asynchronous tasks using the features of the C++11/14

### Requirements
A compiler supporting the C++14 features

### Features
###### Components
* A ThreadPool, manages workers (threads).
* A Task manager for running tasks asynchronously.
* A Scheduler for scheduling tasks asynchronously.

###### Interface
* The library exposes a module with free functions for creating managers and schedulers.

### Basic Usage
###### Manager
```C++
// Create the thread pool with the initial number of threads (2 here).
Task::Module::init(2);

// Create a task manager with one worker.
auto manager = Task::Module::makeManager(1);

// Add a new task and get its future.
auto future = manager.launch([] { return 42; });

// Get the result from the future and print it.
std::cout << future.get() << std::endl;

// Not necessary here, but the stop method ensures that all launched tasks have been executed.
manager.stop().get();
```

In the above example if we were to push more tasks, only one at a time would be executed as the manager has only one worker assigned.

###### Scheduler
```C++
// Create the thread pool with the initial number of threads (2 here).
Task::Module::init(2);

// Create a scheduler with one worker.
auto scheduler = Task::Module::makeScheduler(1);

// Declare the variable n.
size_t n = 0;

// Add new tasks and get the future.
scheduler.scheduleIn("Task1", std::chrono::seconds(2), [&n] { n++; });
auto future = scheduler.scheduleIn("Task2", std::chrono::seconds(1), [&n] { n = 41 });

// Get the future and print the updated value.
future.get()
std::cout << n << std::endl;

// Not necessary here, but the stop method ensures that all the scheduled tasks have been executed.
scheduler.stop().get();
```

The same note applies for the scheduler regarding the number of associated workers.
Also an identifier ("TaskX") is provided so that periodic tasks could be removed.

{'fraction_non_alphanumeric': 0.11447084233261338, 'fraction_numerical': 0.008399328053755699, 'mean_word_length': 4.309554140127388, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 3, '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': '5335494', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1111, 'n_words': 538}