{"id":23154438,"url":"https://github.com/mericluc/miniloop","last_synced_at":"2025-06-16T02:06:26.462Z","repository":{"id":148350993,"uuid":"519620191","full_name":"MericLuc/miniloop","owner":"MericLuc","description":"A basic C++ event loop  wrapping libevent","archived":false,"fork":false,"pushed_at":"2023-07-10T10:17:44.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T16:47:59.569Z","etag":null,"topics":["cpp","event-loop","libevent","wrapper"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MericLuc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-07-30T21:03:48.000Z","updated_at":"2024-12-04T08:22:09.000Z","dependencies_parsed_at":"2025-04-04T16:43:51.514Z","dependency_job_id":"fd0a066d-92bc-4872-9675-93ef26667bfc","html_url":"https://github.com/MericLuc/miniloop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MericLuc/miniloop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MericLuc%2Fminiloop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MericLuc%2Fminiloop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MericLuc%2Fminiloop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MericLuc%2Fminiloop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MericLuc","download_url":"https://codeload.github.com/MericLuc/miniloop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MericLuc%2Fminiloop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260083863,"owners_count":22956408,"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":["cpp","event-loop","libevent","wrapper"],"created_at":"2024-12-17T20:12:46.395Z","updated_at":"2025-06-16T02:06:26.447Z","avatar_url":"https://github.com/MericLuc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# miniLoop\n\n**:star2: A lightweight C++ wrapper around libevent :star2:**\n\nNothing fancy, miniLoop is a quick and easy-to-use event-loop with basic functionalities :\n- Listen on read/write on a file descriptor\n- Set timeouts (oneshot and recurrent) \n- Register on unix signals\n- ... that is pretty much it !\n\nTo use it, just start the loop and register your callbacks on the events of your choice.\n\nIt wraps [libevent](https://libevent.org/) and is therefore easily extendable to fit your needs.\n\n## How to use\n\n```c++\n#include \u003cminiLoop/Loop.h\u003e\n#include \u003csignal.h\u003e\n#include \u003ciostream\u003e\n#include \u003cmemory\u003e\n\n#define TIMEOUT_HOURLY 3600 * 1000\n\nusing namespace loop;\n\nint main(/*int argc, char* argv[]*/) {\n\n    // Subscribe to SIGINT signal for example\n    auto sigintEvt{ Loop::UNIX_SIGNAL(SIGINT) };\n    sigintEvt.onEvent([](int) { /*graceful_exit(SIGINT);*/ });\n\n    // Remember to take a break from screen every hour !\n    auto takeBreak{ std::make_unique\u003cLoop::RecurrentTimeout\u003e(TIMEOUT_HOURLY) };\n    takeBreak-\u003eonTimeout([](){\n        std::cout \u003c\u003c \"Take a break !\" \u003c\u003c std::endl;\n    });\n\n    // Start the loop\n    Loop::singleton().run();\n\n    return EXIT_SUCCESS;\n}\n```\n\n\n## How to install\n\n- Install\n\n```bash\ncmake [-S ${path/to/src}] [-DCMAKE_NSTALL_PREFIX=${install/prefix}] .\nmake\nmake install\n```\n\n- Uninstall\n\n```bash\nmake uninstall\n```\n\n- Configuration options\n\n| name                 | type     | description                        | default value\n| -------------------- | -------- | ---------------------------------- | ---------------\n|  `BUILD_SHARED_LIBS` | boolean  | Build miniLoop as a shared library | ON\n|  `BUILD_EXAMPLE`     | boolean  | Also build provided usage example  | OFF\n\n\n## Dependencies\n\nminiLoop depends on :\n- [libevent](https://libevent.org/)\n- [miniJSON](https://github.com/MericLuc/minijson), which is easy to install from [here](https://github.com/MericLuc/minijson).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmericluc%2Fminiloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmericluc%2Fminiloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmericluc%2Fminiloop/lists"}