{"id":21509253,"url":"https://github.com/mark24code/rb_simulate_eventloop","last_synced_at":"2025-03-17T15:14:53.185Z","repository":{"id":82887416,"uuid":"523667389","full_name":"Mark24Code/rb_simulate_eventloop","owner":"Mark24Code","description":"use Ruby mock eventloop","archived":false,"fork":false,"pushed_at":"2022-08-11T10:56:59.000Z","size":568,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T01:08:21.341Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mark24Code.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":"2022-08-11T09:46:48.000Z","updated_at":"2023-03-05T02:58:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"48b3aef5-440a-4619-9454-b4dafccd2ca9","html_url":"https://github.com/Mark24Code/rb_simulate_eventloop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Frb_simulate_eventloop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Frb_simulate_eventloop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Frb_simulate_eventloop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Frb_simulate_eventloop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mark24Code","download_url":"https://codeload.github.com/Mark24Code/rb_simulate_eventloop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056424,"owners_count":20390719,"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":[],"created_at":"2024-11-23T21:22:36.152Z","updated_at":"2025-03-17T15:14:53.165Z","avatar_url":"https://github.com/Mark24Code.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby code simulate Eventloop\n\n\n## Run sample\n\nuse Ruby code simulate Eventloop\n\n`ruby sample.rb`\n\n`node sample.js`\n\ncompare the result \n\n\n## Simulate Features\n\nsimulate eventloop\n\n* macro_task\n* micro_task\n* settimeout ( timer micro_task)\n* promise (micro_task)\n\n## Eventloop Model\n\n```\n（start)\n   |\n  init (e.g create TimerThread )\n   |\n  sync task (e.g read \u0026 run code) \n   |                                        \n   |\n ------------------\u003e\n|                  |                                    -------------\n|               macro_task  ---  add timer task --\u003e    | TimerThread |\n|   (Eventloop)    |       \u003c--  insertjob result ---    -------------\n|                  |\n|               micro_task\n|                  |\n|                  |\n \u003c-----------------   \n   |\n   |\n  (end)\n\n```\n\n## Sample Result\n\n![sample_result](./sample_result.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark24code%2Frb_simulate_eventloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark24code%2Frb_simulate_eventloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark24code%2Frb_simulate_eventloop/lists"}