{"id":22832568,"url":"https://github.com/waldner/rq-frontend","last_synced_at":"2025-03-31T02:19:01.113Z","repository":{"id":92012183,"uuid":"302977992","full_name":"waldner/rq-frontend","owner":"waldner","description":"Submit jobs to Redis Queue from any language using an HTTP API.","archived":false,"fork":false,"pushed_at":"2024-01-06T14:23:46.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T07:21:17.046Z","etag":null,"topics":["python-rq","rq"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waldner.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":"2020-10-10T19:45:40.000Z","updated_at":"2024-03-29T08:15:38.000Z","dependencies_parsed_at":"2024-01-06T15:32:58.656Z","dependency_job_id":"1522d1a9-33c7-477b-8075-c000634db65c","html_url":"https://github.com/waldner/rq-frontend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldner%2Frq-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldner%2Frq-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldner%2Frq-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waldner%2Frq-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waldner","download_url":"https://codeload.github.com/waldner/rq-frontend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246403902,"owners_count":20771530,"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":["python-rq","rq"],"created_at":"2024-12-12T21:08:01.528Z","updated_at":"2025-03-31T02:19:01.095Z","avatar_url":"https://github.com/waldner.png","language":"Python","readme":"# rq-frontend\nSubmit jobs to [Redis Queue](https://python-rq.org) from any language using an HTTP API.\n\n# WARNING: work in progress.\n### WARNING: I made this after reading just two Flask tutorials. It's surely ugly and can be made better.\n\nThis is a quick hack thrown together to let non-python apps and service submit jobs to RQ.\n\n# Getting started\n\nBuild the docker image or download it from [Docker Hub](https://hub.docker.com/r/waldner/rq-frontend):\n\n```\n# build\ndocker build -t waldner/rq-frontend .\n\n# download\ndocker pull waldner/rq-frontend\n```\n\nCreate a `.env` file with the following content:\n\n```\n# where to find redis\nRQ_FRONTEND_REDIS_URL=192.168.77.8\n# where we want rq-frontend to listen for requests\nHTTP_ADDR=192.168.0.1\nHTTP_PORT=4356\n```\n\nStart the container: `docker-compose up -d`\n\n# Usage\n\nExamples are with curl for simplicity, but of course any language or framework that can do HTTP requests will do.\n\n## Submit a job:\n\n```\n$ curl http://192.168.0.1:4356 -d '{\"task\":\"tasks.sampletask\", \"params\": {\"result_ttl\": 0, \"args\": [60], \"kwargs\": { \"arg1\": \"hello\", \"arg2\": \"world\" }}'\n{\"status\": \"submitted\", \"job_id\": \"a70eedf2-f121-4a02-bf45-5acd82ec9bc7\"}\n```\n\nOptionally, a queue name can be specified:\n\n```\n$ curl http://192.168.0.1:4356 -d '{\"queue\": \"high\", \"task\":\"tasks.sampletask\", \"params\": {\"result_ttl\": 0, \"args\": [60], \"kwargs\": { \"arg1\": \"hello\", \"arg2\": \"world\" }}'\n{\"status\": \"submitted\", \"job_id\": \"a70e2d42-f121-4602-bf45-5a7d828c91c7\"}\n```\n\nThe payload JSON must contain two keys: `task` with the name of the task to run as recognized by the workers, and `params` with the values to be passed to the worker when the job is enqueued. The `queue` key is optional, and if missing the default queue named `default` is used to submit the job. In the above example, the `params` part causes the following server-side invocation to enqueue the job:\n\n```\n...\njob = q.enqueue('tasks.sampletask', result_ttl = 0, args = [60], kwargs = {'arg1': 'hello', 'arg2': 'world' })\n```\n\n## Retrieve the status of a job:\n\n```\n$ curl -s http://192.168.0.1:4356/info?job_id=a70eedf2-f121-4a02-bf45-5acd82ec9bc7 | jq -r .\n{\n  \"status\": \"started\",\n  \"func_name\": \"tasks.sampletask\",\n  \"args\": [\n    60\n  ],\n  \"meta\": {},\n  \"is_finished\": false,\n  \"is_failed\": false,\n  \"kwargs\": {\n    \"arg1\": \"hello\",\n    \"arg2\": \"world\"\n  },\n  \"result\": null,\n  \"enqueued_at\": \"2020-10-10 19:35:05\",\n  \"started_at\": \"2020-10-10 19:35:05\",\n  \"ended_at\": null,\n  \"exc_info\": null\n}\n\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaldner%2Frq-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaldner%2Frq-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaldner%2Frq-frontend/lists"}