{"id":26223404,"url":"https://github.com/stellaraf/go-task-queue","last_synced_at":"2026-04-20T08:33:13.571Z","repository":{"id":195630686,"uuid":"693327281","full_name":"stellaraf/go-task-queue","owner":"stellaraf","description":"A Redis-backed task queue with a simple API","archived":false,"fork":false,"pushed_at":"2023-10-31T20:32:20.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T20:10:54.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stellaraf.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":"2023-09-18T20:02:38.000Z","updated_at":"2023-09-18T20:04:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"1eaa321f-806c-4bab-ba17-d2a2a13884b6","html_url":"https://github.com/stellaraf/go-task-queue","commit_stats":null,"previous_names":["stellaraf/go-task-queue"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/stellaraf/go-task-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellaraf%2Fgo-task-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellaraf%2Fgo-task-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellaraf%2Fgo-task-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellaraf%2Fgo-task-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stellaraf","download_url":"https://codeload.github.com/stellaraf/go-task-queue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellaraf%2Fgo-task-queue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32040167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":[],"created_at":"2025-03-12T17:32:38.262Z","updated_at":"2026-04-20T08:33:13.500Z","avatar_url":"https://github.com/stellaraf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"https://res.cloudinary.com/stellaraf/image/upload/v1604277355/stellar-logo-gradient.svg\" width=\"300\" /\u003e\n  \u003cbr/\u003e\n  \u003ch3\u003e\u003ccode\u003etaskqueue\u003c/code\u003e\u003c/h3\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://github.com/stellaraf/go-task-queue/tags\"\u003e\n    \u003cimg alt=\"GitHub tag (latest SemVer)\" src=\"https://img.shields.io/github/v/tag/stellaraf/go-task-queue?color=%2306D6A0\u0026label=version\u0026style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/stellaraf/go-utils/actions/workflows/tests.yml\"\u003e\n    \u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/stellaraf/go-utils/tests.yml?style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/stellaraf/go-task-queue\"\u003e\n    \u003cimg alt=\"GoDoc Reference\" src=\"https://img.shields.io/badge/godoc-reference-5272B4.svg?style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n\n\u003c/div\u003e\n\n# Usage\n\n  ## Basic Task Queue\n  `BasicTaskQueue` is a simple task queue that stores tasks as strings.\n\n  ```go\n  queue, err := taskqueue.NewBasic(\"queue-name\")\n  queue.Add(\"example1\", \"example2\")\n  value := queue.Pop()\n  // example1\n  value = queue.Pop()\n  // example2\n  ```\n\n  ## JSON Task Queue\n  `JSONTaskQueue` provides a very similar API to `BasicTaskQueue` and has the ability to store virtually any objet type as a task.\n\n  ```go\n  type Data struct {\n    System string\n    Count int\n  }\n\n  type Task struct {\n    ID string `json:\"id\"`\n    Details []string `json:\"details\"`\n    Timestamp time.Time `json:\"timestamp\"`\n    Data *Data `json:\"data\"`\n  }\n\n  task := Task{\n    ID: \"1234\",\n    Details: []string{\"some\", \"details\"},\n    Timestamp: time.Now(),\n    Data: \u0026Data{System: \"aws\", Count: 5},\n  }\n\n  queue, err := taskqueue.NewJSON(\"queue-name\")\n  queue.Add(task)\n  var fromQueue *Task\n  queue.Pop(\u0026fromQueue)\n  ```\n\n  ## Options\n\n  Both `BasicTaskQueue` and `JSONTaskQueue` support the same options:\n\n  ```go\n  taskqueue.NewBasic(\n    \"queue-name\",\n    // Use a Redis connection string instead of WithHost/WithUsername/WithPassword.\n    taskqueue.WithURI(\"redis://redis-username:redispassword@your-redis-host.example.com:55032\"),\n    // Set the Redis hostname. By default, this is localhost.\n    taskqueue.WithHost(\"your-redis-host.example.com\"),\n    // Set the Redis username.\n    taskqueue.WithUsername(\"redis-username\"),\n    // Set the Redis password.\n    taskqueue.WithPassword(\"redis-password\"),\n    // Use your own context object. Useful if operating from within a web request.\n    taskqueue.WithContext(context.Background()),\n    // Set a Redis read/write timeout.\n    taskqueue.WithTimeout(time.Seconds*10),\n    // Add your own TLS configuration.\n    taskqueue.WithTLSConfig(\u0026tls.Config{InsecureSkipVerify: true}),\n    // Don't re-add tasks to the queue that fail when unmarshaled.\n    taskqueue.WithNoRetry(),\n  )\n  ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstellaraf%2Fgo-task-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstellaraf%2Fgo-task-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstellaraf%2Fgo-task-queue/lists"}