{"id":20466741,"url":"https://github.com/tastyep/taskmanager","last_synced_at":"2025-04-13T09:10:45.258Z","repository":{"id":34614714,"uuid":"38563512","full_name":"Tastyep/TaskManager","owner":"Tastyep","description":"A C++14 Task Manager / Scheduler","archived":false,"fork":false,"pushed_at":"2023-08-02T17:49:59.000Z","size":360,"stargazers_count":105,"open_issues_count":1,"forks_count":23,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-27T00:54:14.192Z","etag":null,"topics":["async","asynchronous","cpp","multithreading","task-manager","task-scheduler","taskmanager","thread-pool","workers"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tastyep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-05T09:21:26.000Z","updated_at":"2025-02-13T12:25:33.000Z","dependencies_parsed_at":"2024-11-15T13:27:08.465Z","dependency_job_id":"783c6211-7495-41da-9dc4-7cb772b52f0c","html_url":"https://github.com/Tastyep/TaskManager","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tastyep%2FTaskManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tastyep%2FTaskManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tastyep%2FTaskManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tastyep%2FTaskManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tastyep","download_url":"https://codeload.github.com/Tastyep/TaskManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688565,"owners_count":21145766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","asynchronous","cpp","multithreading","task-manager","task-scheduler","taskmanager","thread-pool","workers"],"created_at":"2024-11-15T13:25:21.152Z","updated_at":"2025-04-13T09:10:45.237Z","avatar_url":"https://github.com/Tastyep.png","language":"C++","readme":"![alt text](https://raw.githubusercontent.com/Tastyep/TaskManager/master/assets/task_manager_logo.png)\n\n[![Build Status](https://travis-ci.org/Tastyep/TaskManager.svg?branch=master)](https://travis-ci.org/Tastyep/TaskManager)\n\nTaskManager is an asynchronous task management library using the features of C++14.\n\n### Requirements\nA compiler supporting the C++14 features.\n\n### Features\n###### Components\n* A ThreadPool, manages workers (threads).\n* A Task manager for running tasks asynchronously.\n* A Scheduler for scheduling tasks asynchronously.\n\n###### Interface\n* The library exposes a module with free functions for creating managers and schedulers.\n\n### Documentation\nOnline documentation can be found [here](https://tastyep.github.io/TaskManager/API/html/index.html).\n\nThe documentation is generated using [Doxygen](https://www.stack.nl/~dimitri/doxygen/) which means it can also be found in the source code.\n\nNote: Files located in the detail/ directories are left undocumented as they are not exposed and only used internally.\n\n### Basic Usage\n###### Manager\n\nNote: The following examples use chrono literals.\n\n```C++\n// Create the thread pool with the initial number of threads (2 here).\nTask::Module::init(2);\n\n// Create a task manager with one worker.\nauto manager = Task::Module::makeManager(1);\n\n// Add a new task and get its future.\nauto future = manager.push([] { return 42; });\n\n// Get the result from the future and print it.\nstd::cout \u003c\u003c future.get() \u003c\u003c std::endl; // Prints 42\n\n// Not necessary here, but the stop method ensures that all launched tasks have been executed.\nmanager.stop().get();\n```\n\nIn 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.\n\n###### Scheduler\n```C++\n// Create the thread pool with the initial number of threads (2 here).\nTask::Module::init(2);\n\n// Create a scheduler with one worker.\nauto scheduler = Task::Module::makeScheduler(1);\n\n// Declare the variable n.\nsize_t n = 0;\n\n// Add new tasks and get the future.\nauto future = scheduler.scheduleIn(\"Task1\", 2s, [\u0026n] { n++; });\nscheduler.scheduleIn(\"Task2\", 1s, [\u0026n] { n = 41 });\n\n// Get the future and print the updated value.\nfuture.get()\nstd::cout \u003c\u003c n \u003c\u003c std::endl; // Prints 42\n\n// Not necessary here, but the stop method ensures that all the scheduled tasks have been executed.\nscheduler.stop().get();\n```\n\nThe same note applies for the scheduler regarding the number of associated workers.\nAlso an identifier (\"TaskX\") is provided so that periodic tasks could be removed.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftastyep%2Ftaskmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftastyep%2Ftaskmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftastyep%2Ftaskmanager/lists"}