{"id":22899717,"url":"https://github.com/wolfulus/cppscheduler","last_synced_at":"2025-09-09T00:37:40.478Z","repository":{"id":33955775,"uuid":"37684888","full_name":"WoLfulus/cppscheduler","owner":"WoLfulus","description":"simple c++11 scheduler","archived":false,"fork":false,"pushed_at":"2016-02-02T02:16:59.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T17:50:28.341Z","etag":null,"topics":["boost","cpp","cpp11","cron","header-only","schedule","scheduler","timer","timers"],"latest_commit_sha":null,"homepage":null,"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/WoLfulus.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}},"created_at":"2015-06-18T21:03:23.000Z","updated_at":"2022-12-31T06:31:07.000Z","dependencies_parsed_at":"2022-07-13T21:43:42.168Z","dependency_job_id":null,"html_url":"https://github.com/WoLfulus/cppscheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WoLfulus/cppscheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoLfulus%2Fcppscheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoLfulus%2Fcppscheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoLfulus%2Fcppscheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoLfulus%2Fcppscheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WoLfulus","download_url":"https://codeload.github.com/WoLfulus/cppscheduler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoLfulus%2Fcppscheduler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231097,"owners_count":25245687,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["boost","cpp","cpp11","cron","header-only","schedule","scheduler","timer","timers"],"created_at":"2024-12-14T01:16:04.037Z","updated_at":"2025-09-09T00:37:40.452Z","avatar_url":"https://github.com/WoLfulus.png","language":"C++","readme":"cppscheduler\n============\n\nSimple C++11 task scheduler based on dbader's [schedule](https://github.com/dbader/schedule \"schedule\") library (python).\n\nIn-process scheduler for periodic jobs that uses builder pattern for configuration. cppscheduler lets you run any thing convertible to a **std::function\u003cvoid()\u003e** periodically at pre-determined intervals using a simple human-friendly syntax.\n\nFeatures\n--------\n\n- Simple fluent/builder API\n- Allows single or multi thread updates\n- Thread-safe\n- Single-file header only\n\nDependencies\n------------\n\n**cppscheduler** depends on **boost**. If you want to compile the Visual Studio 2013 project, you must set BOOST_DIR environment variable with the path of boost's include directory.\n\nUsage\n-----\n\nCreating the scheduler manager.\n\n```c++\n\n    scheduler::manager mgr;\n```\n\nRegistering tasks\n\n```cpp\n    \n    mgr.every(10).minutes().run([]() {\n        cout \u003c\u003c \"Hello world every 10 minutes.\" \u003c\u003c endl;\n    });\n    \n    mgr.every().hours().run([]() {\n        cout \u003c\u003c \"Hello world every hour.\" \u003c\u003c endl;\n    });\n    \n    mgr.every().days().run([]() {\n        cout \u003c\u003c \"Hello world every day.\" \u003c\u003c endl;\n    });\n            \n    mgr.every().days().at(\"09:00\").run([]() {\n        cout \u003c\u003c \"Hello world every day at 09:00am.\" \u003c\u003c endl;\n    });\n\n    mgr.every(2).days().at(\"15:00\").run([]() {\n        cout \u003c\u003c \"Hello world every 2 days at 15:00pm.\" \u003c\u003c endl;\n    });\n\n    mgr.every().sunday().at(\"16:00\").run([]() {\n        cout \u003c\u003c \"Hello world every sunday at 16:00pm.\" \u003c\u003c endl;\n    });\n\n```\n\nCanceling a task\n\n```cpp\n    \n    mgr.every().seconds().run([]() {\n        cout \u003c\u003c \"Hello once.\" \u003c\u003c endl;\n        throw scheduler::cancel_task();\n    });\n\n```\n\nUpdating the scheduler on your own\n\n```cpp\n\n    while (true)\n\t{\n\t\tmgr.update();\n\t\tboost::this_thread::sleep_for(\n\t\t\tboost::chrono::milliseconds(200));\n\t}\n\n```\n\nLeaving updates to the scheduler \n\n*Note that this will create an additional thread and all updates will run under scheduler's thread*\n\n\n```cpp\n \n\t// 200 is optional (the delay for each update)\n\tmgr.start(200);\n\t\n```\n\nDistributed under the MIT license. See ``LICENSE`` for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfulus%2Fcppscheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolfulus%2Fcppscheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfulus%2Fcppscheduler/lists"}