{"id":13577622,"url":"https://github.com/cloudwu/ltask","last_synced_at":"2025-10-10T05:33:39.319Z","repository":{"id":2013815,"uuid":"331940901","full_name":"cloudwu/ltask","owner":"cloudwu","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-27T09:34:25.000Z","size":431,"stargazers_count":289,"open_issues_count":0,"forks_count":51,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-08T18:18:16.593Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cloudwu.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":"2021-01-22T12:33:16.000Z","updated_at":"2025-03-28T08:18:02.000Z","dependencies_parsed_at":"2023-09-23T03:43:44.046Z","dependency_job_id":"6e972645-5f49-4003-a14e-d13ccd582608","html_url":"https://github.com/cloudwu/ltask","commit_stats":{"total_commits":158,"total_committers":9,"mean_commits":"17.555555555555557","dds":0.5253164556962026,"last_synced_commit":"c5d867e48f8efb7d540af7237dfd6a147e9bf9c7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwu%2Fltask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwu%2Fltask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwu%2Fltask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudwu%2Fltask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudwu","download_url":"https://codeload.github.com/cloudwu/ltask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485064,"owners_count":22078767,"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-08-01T15:01:23.000Z","updated_at":"2025-10-10T05:33:34.289Z","avatar_url":"https://github.com/cloudwu.png","language":"C","funding_links":[],"categories":["C","Resources"],"sub_categories":["Multitasking"],"readme":"ltask: Yet another lua task library\n============================\n\nltask is inspired by skynet (https://github.com/cloudwu/skynet) , but it's a library rather than a framework.\n\nIt implement an n:m scheduler , so that you can run M lua VMs on N OS threads.\n\nEach lua service (an indepentent lua VM) works in request/response mode, they use message channels to inter-communicate.\n\n`root` is a special service that can spawn new services. For example, \n\n```lua\n-- user\nlocal ltask = require \"ltask\"\n\nlocal S = {}\n\nprint \"User Start\"\n\nfunction S.ping(...)\n\tltask.timeout(10, function() print(1) end)\n\tltask.timeout(20, function() print(2) end)\n\tltask.timeout(30, function() print(3) end)\n\tltask.sleep(40) -- sleep 0.4 sec\n\t-- response\n\treturn \"PING\", ...\nend\n\nreturn S\n```\n\n```lua\n-- root\nlocal function boot()\n\tprint \"Root Start\"\n\tprint(os.date(\"%c\", (ltask.now())))\n\tlocal addr = S.spawn(\"user\", \"Hello\")\t-- spawn a new service `user`\n\tprint(ltask.call(addr, \"ping\", \"PONG\"))\t-- request \"ping\" message\nend\n\nboot()\n```\n\nTest\n====\n```\nlua test.lua\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudwu%2Fltask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudwu%2Fltask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudwu%2Fltask/lists"}