{"id":21177715,"url":"https://github.com/kasyap1234/distributed-task-queue","last_synced_at":"2026-04-18T19:33:35.952Z","repository":{"id":251221159,"uuid":"835343929","full_name":"kasyap1234/distributed-task-queue","owner":"kasyap1234","description":"A highly scalable distributed task queue system in Go, utilizing Redis for job storage, PostgreSQL for result persistence, and concurrent workers with exponential backoff for efficient job processing and scheduling.","archived":false,"fork":false,"pushed_at":"2025-03-23T05:20:17.000Z","size":26,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T19:36:52.990Z","etag":null,"topics":["distributed-systems","go","golang","redis"],"latest_commit_sha":null,"homepage":"","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/kasyap1234.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,"zenodo":null}},"created_at":"2024-07-29T16:33:09.000Z","updated_at":"2025-01-03T15:44:06.000Z","dependencies_parsed_at":"2025-08-01T19:21:58.481Z","dependency_job_id":"710257fd-25c5-42f4-bd70-e1c234e7ef6a","html_url":"https://github.com/kasyap1234/distributed-task-queue","commit_stats":null,"previous_names":["kasyap1234/distributed-task-queue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kasyap1234/distributed-task-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasyap1234%2Fdistributed-task-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasyap1234%2Fdistributed-task-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasyap1234%2Fdistributed-task-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasyap1234%2Fdistributed-task-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kasyap1234","download_url":"https://codeload.github.com/kasyap1234/distributed-task-queue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasyap1234%2Fdistributed-task-queue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31982743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: 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":["distributed-systems","go","golang","redis"],"created_at":"2024-11-20T17:17:05.809Z","updated_at":"2026-04-18T19:33:35.924Z","avatar_url":"https://github.com/kasyap1234.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed Task Queue\n\nA robust, scalable distributed task queue system implemented in Go, designed to handle various types of jobs efficiently.\n\n## Features\n\n- Concurrent job processing\n- Redis-based queue for job storage and retrieval\n- Job scheduling for recurring tasks\n- RESTful API for job submission\n- Configurable worker count and timeout\n- Exponential backoff strategy for efficient queue polling\n- Support for multiple job types (email, image resizing, data processing)\n- Persistent storage for job results\n\n## Components\n\n### Worker (worker.go)\n\nThe worker component is responsible for processing jobs from the queue. It supports:\n\n- Concurrent job processing\n- Custom job type handlers\n- Exponential backoff for efficient queue polling\n\n### Scheduler (scheduler.go)\n\nThe scheduler allows for the creation of recurring jobs. It uses a cron-like syntax for job scheduling.\n\n### Queue (queue.go)\n\nImplements a Redis-based queue for job storage and retrieval. Supports operations like:\n\n- Enqueue\n- Dequeue\n- Update job status\n\n### Job (job.go)\n\nDefines the structure for different job types, including:\n\n- Email jobs\n- Image resizing jobs\n- Data processing jobs\n\n### Handlers (handler.go)\n\nContains the logic for processing different job types:\n\n- Email sending\n- Image resizing\n- Data processing\n\n### Storage (storage.go)\n\nManages persistent storage of job results using PostgreSQL.\n\n### Config (config.go)\n\nHandles application configuration using Viper, allowing for easy management of:\n\n- Redis connection details\n- Worker count and timeout\n- API server address\n\n## Getting Started\n\n1. Ensure Redis and PostgreSQL are installed and running.\n2. Set up the configuration in `config.go` or use environment variables.\n3. Run the main application:\n\n\n4. The API server will start, and you can submit jobs via POST requests to `/submit`.\n\n## API Usage\n\nSubmit a job:\n\nPOST /submit Content-Type: application/json\n\n{ \"type\": \"email\", \"payload\": { \"to\": \"user@example.com\", \"subject\": \"Test Email\", \"body\": \"This is a test email.\" } }\n\n\n## Configuration\n\nThe application can be configured using environment variables:\n\n- `REDISADDR`: Redis server address (default: \"127.0.0.1:6379\")\n- `MAXRETRIES`: Maximum job retry attempts (default: 5)\n- `WORKERCOUNT`: Number of concurrent workers (default: 10)\n- `APIADDR`: API server address (default: \"127.0.0.1:8080\")\n- `WORKERTIMEOUT`: Worker timeout in seconds (default: 10)\n\n## Extending the System\n\nTo add new job types:\n\n1. Define the job structure in `job.go`\n2. Implement the job handler in `handler.go`\n3. Register the new handler in `main.go`\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasyap1234%2Fdistributed-task-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkasyap1234%2Fdistributed-task-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasyap1234%2Fdistributed-task-queue/lists"}