Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit ffd7dd6

Browse files
authored
Update the ReadMe file
- Display the logo on top. - Fix an error in the scheduler usage.
1 parent 0c2be4f commit ffd7dd6

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# TaskManager
2-
A C++ TaskManager aiming at easily managing asynchronous tasks using the features of the C++11/14
1+
![alt text](https://raw.githubusercontent.com/Tastyep/TaskManager/master/assets/task_manager_logo.png)
2+
3+
TaskManager is an asynchronous task management library using the features of C++14.
34

45
### Requirements
5-
A compiler supporting the C++14 features
6+
A compiler supporting the C++14 features.
67

78
### Features
89
###### Components
@@ -26,7 +27,7 @@ auto manager = Task::Module::makeManager(1);
2627
auto future = manager.launch([] { return 42; });
2728

2829
// Get the result from the future and print it.
29-
std::cout << future.get() << std::endl;
30+
std::cout << future.get() << std::endl; // Prints 42
3031

3132
// Not necessary here, but the stop method ensures that all launched tasks have been executed.
3233
manager.stop().get();
@@ -46,12 +47,12 @@ auto scheduler = Task::Module::makeScheduler(1);
4647
size_t n = 0;
4748
4849
// Add new tasks and get the future.
49-
scheduler.scheduleIn("Task1", std::chrono::seconds(2), [&n] { n++; });
50-
auto future = scheduler.scheduleIn("Task2", std::chrono::seconds(1), [&n] { n = 41 });
50+
auto future = scheduler.scheduleIn("Task1", std::chrono::seconds(2), [&n] { n++; });
51+
scheduler.scheduleIn("Task2", std::chrono::seconds(1), [&n] { n = 41 });
5152
5253
// Get the future and print the updated value.
5354
future.get()
54-
std::cout << n << std::endl;
55+
std::cout << n << std::endl; // Prints 42
5556
5657
// Not necessary here, but the stop method ensures that all the scheduled tasks have been executed.
5758
scheduler.stop().get();

0 commit comments

Comments
 (0)