{"id":18268413,"url":"https://github.com/bionelabs/eventloop","last_synced_at":"2025-04-09T02:46:56.196Z","repository":{"id":177124628,"uuid":"258581016","full_name":"bionelabs/EventLoop","owner":"bionelabs","description":"A simple C thread pool implementation with single core","archived":false,"fork":false,"pushed_at":"2020-04-24T17:47:21.000Z","size":46,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T21:25:59.188Z","etag":null,"topics":["c","caophuocthanh","eventloop","onebuffer","queue","xcode"],"latest_commit_sha":null,"homepage":"https://onebuffer.com","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/bionelabs.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":"2020-04-24T17:39:32.000Z","updated_at":"2023-12-04T17:42:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"0869579d-6e92-471b-bd09-c917c6f7924e","html_url":"https://github.com/bionelabs/EventLoop","commit_stats":null,"previous_names":["bionelabs/eventloop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bionelabs%2FEventLoop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bionelabs%2FEventLoop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bionelabs%2FEventLoop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bionelabs%2FEventLoop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bionelabs","download_url":"https://codeload.github.com/bionelabs/EventLoop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968240,"owners_count":21025797,"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":["c","caophuocthanh","eventloop","onebuffer","queue","xcode"],"created_at":"2024-11-05T11:31:26.355Z","updated_at":"2025-04-09T02:46:56.174Z","avatar_url":"https://github.com/bionelabs.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EventLoop\nA simple C thread pool implementation with single core\n\n## Include:\n- setTimeOut\n- setImmedate\n- setInterval\n- emit and listen\n\n## Use\n```c++\ninclude \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cunistd.h\u003e\n#include \"EventLoop.h\"\n\nstatic int addTaskO = 0;\n\nvoid calbackTaskA() {\n    printf(\"A event calback\\n\");\n}\n\nvoid calbackTaskB() {\n    printf(\"B event calback\\n\");\n    if (addTaskO == 0) { // add more task when all stask runing\n        addTaskO = 1;\n    }\n    EventShared().setImmedate(calbackTaskA);\n    EventShared().emit(4555, \"hjgjhgjhg\", \"df\", 2342);\n}\n\nvoid calbackTaskC() {\n    printf(\"C event calback\\n\");\n    EventShared().emit(4555, \"6666666666ghfjghf\", \"9999999999999jhgfjhgfj\", \"2342\");\n}\n\nvoid calbackTaskD() {\n    printf(\"D event calback\\n\");\n}\n\nvoid calbackStopProcess() {\n    printf(\"calbackStopProcess\\n\");\n    EventShared().remove(4555);\n    EventShared().exit();\n}\n\nint main(int argc, const char * argv[]) {\n    // add Tasks\n    EventShared().setImmedate(calbackTaskA);\n    EventShared().setInterval(calbackTaskB, 5*1000);\n    EventShared().setTimeout(calbackTaskB, 10*1000);\n    EventShared().setTimeout(calbackStopProcess, 120*1000);\n    EventShared().setTimeout(calbackTaskA, 2*1000);\n    EventShared().setTimeout(calbackTaskB, 2*1000);\n    EventShared().setInterval(calbackTaskC, 2*1000);\n    \n    // run loop\n    EventShared().loop();\n\n    return 0;\n}\n\n```\n\n\n## Contact\n- Email: caophuocthanh@gmail.com\n- Site: https://onebuffer.com\n- Linkedin: https://www.linkedin.com/in/caophuocthanh/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbionelabs%2Feventloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbionelabs%2Feventloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbionelabs%2Feventloop/lists"}