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);
2627auto 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.
3233manager.stop().get();
@@ -46,12 +47,12 @@ auto scheduler = Task::Module::makeScheduler(1);
4647size_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.
5354future.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.
5758scheduler.stop().get();
0 commit comments