{"id":19282217,"url":"https://github.com/theskyinflames/runner","last_synced_at":"2026-06-13T06:31:13.375Z","repository":{"id":137365657,"uuid":"151879754","full_name":"theskyinflames/runner","owner":"theskyinflames","description":"a simple task runner","archived":false,"fork":false,"pushed_at":"2019-03-27T13:11:05.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T05:33:02.809Z","etag":null,"topics":["concurrency","golang","golang-library","task-runner","theskyinflames","threadsafe"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/theskyinflames.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":"2018-10-06T20:39:24.000Z","updated_at":"2019-03-27T13:11:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8089445-dc94-4691-a8e7-a51315f51a86","html_url":"https://github.com/theskyinflames/runner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theskyinflames/runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theskyinflames%2Frunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theskyinflames%2Frunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theskyinflames%2Frunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theskyinflames%2Frunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theskyinflames","download_url":"https://codeload.github.com/theskyinflames/runner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theskyinflames%2Frunner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34275065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["concurrency","golang","golang-library","task-runner","theskyinflames","threadsafe"],"created_at":"2024-11-09T21:25:49.235Z","updated_at":"2026-06-13T06:31:13.359Z","avatar_url":"https://github.com/theskyinflames.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Task runner\n\nsee [runner_test.go](./runner_test.go) to use cases\n\n## Usage\n1. Take the runner and start it\n```go\n    // Take the runner\n    checkIntervalMS := int64(100)\n\tmyrunner, err := GetRunner(checkIntervalMS)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Starting the runner\n\terr = myrunner.Start()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\t\n\tt.Logf(\"Runner started \\n\")\n```\n\n2. Define the task\n```go\nmytaskimplementation = func(eot chan struct{}, taskManager TaskManager_I, args []interface{}) ([]interface{}, error) {\n\t\t\n\t\tvar c int = 0\n\t\tvar sleep_time int64 = args[0].(int64)\n\t\t\n\t\tvar t time.Time\n\t\tvar exitValue = 1000\n\t\t\n\n\t\tfor { // This loop is necessary to be able to catch the ending signal from the eot (EndOfTask) channel\n\t\t\tselect {\n\t\t\tcase \u003c-eot: // If a signal is read from this channel, the task will finish\n\t\t\t\tfmt.Println(\"The task finalizes by EOT signal ...\")\n\t\t\t\treturn []interface{}{c, t}, nil\n\t\t\t\t\n\t\t\tdefault: // The task implementation\n\t\t\t\ttime.Sleep(time.Duration(sleep_time) * time.Millisecond)\n\t\t\t\tc += 1\n\t\t\t\tt = time.Now()\n\t\t\t\t\n\t\t\t\tif c == exitValue{\n\t\t\t\t    break\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfmt.Println(\"The task has finished by its self ....\")\n\t\treturn []interface{}{c, t}, nil\n\t}\n```\n\n3. Get the runner task. It this case is an infinite task, in other words, a task without deadline\n```go\n    taskID := getUUID()\n    mytask, err = GetTask(taskID, INFINITE_TASK_DURATION, mytaskimplementation)\n```\n\n4. Waking up the task with a parameter and wating for the return\n```go\n    parameter := int64(100)\n    err := myrunner.WakeUpTask(mytask, parameter)\n```\n\n5. Waiting for the response\n```go\n    response := \u003c-mytask.GetResponseChan()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheskyinflames%2Frunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheskyinflames%2Frunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheskyinflames%2Frunner/lists"}