{"id":37099390,"url":"https://github.com/gintec-rdl/rtm","last_synced_at":"2026-01-14T12:04:39.233Z","repository":{"id":228760495,"uuid":"774817940","full_name":"gintec-rdl/rtm","owner":"gintec-rdl","description":"Resident Task Manager for golang","archived":false,"fork":false,"pushed_at":"2024-03-20T10:15:43.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T08:29:20.982Z","etag":null,"topics":["background-worker","go-routine","in-memory","task-manager","task-runner"],"latest_commit_sha":null,"homepage":"","language":"Go","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/gintec-rdl.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}},"created_at":"2024-03-20T08:44:59.000Z","updated_at":"2024-03-20T09:41:48.000Z","dependencies_parsed_at":"2024-03-20T10:59:32.185Z","dependency_job_id":null,"html_url":"https://github.com/gintec-rdl/rtm","commit_stats":null,"previous_names":["gintec-rdl/rtm"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gintec-rdl/rtm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gintec-rdl%2Frtm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gintec-rdl%2Frtm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gintec-rdl%2Frtm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gintec-rdl%2Frtm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gintec-rdl","download_url":"https://codeload.github.com/gintec-rdl/rtm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gintec-rdl%2Frtm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["background-worker","go-routine","in-memory","task-manager","task-runner"],"created_at":"2026-01-14T12:04:38.475Z","updated_at":"2026-01-14T12:04:39.227Z","avatar_url":"https://github.com/gintec-rdl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rtm\n\nResident Task Manager for golang\n\n#### Use case\n\nYou want to run parallel background tasks and you don't care about in memory data loss.\n\n#### Goodies\n\n- ✅ Offers parallel task execution by default\n- ✅ Refined cancellation mechanism to prevent runaway go-routines and leaks.\n- ✅ Crash recovery guarantees misbehaving and naughty tasks get booted off the pool\n- ✅ Unbounded FIFO ring-buffer based backup [queue](https://github.com/eapache/queue) so you can run tasks later when execution pool size drops.\n\n#### Caveats\n\n- ❌ In Memory Only: Tasks and data do not persist.\n- ❌ When cancelling task execution, the calling thread will block indefinitely to wait for all tasks in the executiono pool to finish. Note that tasks on the backup queue are simply dicarded since they never executed.\n\n**Example**\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/gintec-rdl/rtm\"\n\t\"math/rand\"\n\t\"os\"\n\t\"time\"\n)\n\nfunc main() {\n\ttasks := 100\n    poolSize := 5\n\tte := rtm.NewTaskExecutor(poolSize)\n\n\ttask := func(ctx *rtm.TaskContext) {\n\t\tindex := ctx.Args[\"index\"].(int)\n\t\tfmt.Printf(\"[%d] enter\\n\", index)\n        // perform some time consuming action\n\t\ttime.Sleep(time.Duration(rand.Intn(5000)) * time.Millisecond)\n\n        // simulate a crash\n        if rand.Intn(2) == 1 {\n\t\t\tpanic(fmt.Errorf(\"[%d] crashed\", index))\n\t\t}\n\n\t\tfmt.Printf(\"[%d] leave\\n\", index)\n\t}\n\n\tfor i := 0; i \u003c tasks; i++ {\n\t\tparams := rtm.TaskArguments{\"index\": i}\n\t\tte.Queue(task, params)\n\t}\n\n\ttime.Sleep(5 * time.Second)\n\tte.Shutdown()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgintec-rdl%2Frtm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgintec-rdl%2Frtm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgintec-rdl%2Frtm/lists"}