{"id":17063166,"url":"https://github.com/tcbegley/dash-rq-demo","last_synced_at":"2025-10-16T08:52:57.337Z","repository":{"id":53708745,"uuid":"200223061","full_name":"tcbegley/dash-rq-demo","owner":"tcbegley","description":"Long running tasks in Dash using RQ","archived":false,"fork":false,"pushed_at":"2023-02-02T11:01:09.000Z","size":32,"stargazers_count":60,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-10T19:33:28.183Z","etag":null,"topics":["heroku","plotly-dash","redis","rq"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tcbegley.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}},"created_at":"2019-08-02T11:27:01.000Z","updated_at":"2024-04-19T19:24:31.000Z","dependencies_parsed_at":"2023-02-17T18:46:08.731Z","dependency_job_id":null,"html_url":"https://github.com/tcbegley/dash-rq-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tcbegley/dash-rq-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcbegley%2Fdash-rq-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcbegley%2Fdash-rq-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcbegley%2Fdash-rq-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcbegley%2Fdash-rq-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcbegley","download_url":"https://codeload.github.com/tcbegley/dash-rq-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcbegley%2Fdash-rq-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279170813,"owners_count":26118645,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"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":["heroku","plotly-dash","redis","rq"],"created_at":"2024-10-14T10:51:38.670Z","updated_at":"2025-10-16T08:52:57.285Z","avatar_url":"https://github.com/tcbegley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\nThis repository demonstrates use of Redis and RQ for asynchronously executing\nlong running tasks in Plotly Dash. The task the app executes is meaningless, it\nconverts a string to upper case character by character with a time delay for\neach character. Hopefully however the programming pattern is clear and the\nexample should be easily adaptable to other applications.\n\nFrom the [RQ docs][rq-docs]:\n\n\u003e RQ (Redis Queue) is a simple Python library for queueing jobs and processing\n\u003e them in the background with workers.\n\nThis example uses a callback to add longer running tasks to an RQ job queue. A\nsecond callback firing on an interval checks the current status of the job,\neither retrieving the result or updating a progress bar to indicate progress\nmade on the task.\n\nThis example can be run locally, or deployed as is to [Heroku][heroku].\n\n## Run locally\n\nStart by cloning this repository to your machine.\n\n```\ngit clone https://github.com/tcbegley/dash-rq-demo.git\ncd dash-rq-demo\n```\n\n### Docker\n\nIf you have [Docker][docker] installed, run the app with\n\n```sh\ndocker compose up\n```\n\nThe app can be accessed at [localhost:8050](https://127.0.0.1:8050).\n\nYou can alternatively run `docker-compose.dev.yml` for development purposes.\nThis volume mounts the source code into the container and uses a development\nserver so that you can benefit from hot-reloading without rebuilding the\ncontainer.\n\n```sh\ndocker compose -f docker-compose.dev.yml up\n```\n### Run manually\n\nIf you don't want to use Docker, first make sure you have\n[Python\u003e=3.7][python37] and [Redis][redis] installed. Once you've done this you\nwill need to [start a Redis server][redis-server]. See the links for more\ndetails, but probably you will want to run something like:\n\n```sh\nredis-server \u0026\n```\n\nThen do the following (preferably in a virtual environment):\n\n```sh\npip install -r requirements.txt\n\n# runs worker.py in the background and run_locally.py\npython worker.py \u0026 python run_locally.py\n```\n\nThe app can be accessed at [localhost:8050](https://127.0.0.1:8050).\n\n## Heroku\n\nTo deploy your own copy of this app on Heroku, just click on this button:\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)][deploy-endpoint]\n\n**Note**: you may need to wait a few minutes for the Redis addon to start before the app starts working.\n\nAlternatively if you would like to set things up manually, follow the below\nsteps. You will need to install the [Heroku CLI][heroku-cli].\n\nFirst clone this repository and navigate to it\n\n```sh\ngit clone https://github.com/tcbegley/dash-rq-demo.git\ncd dash-rq-demo\n```\n\nCreate a new Heroku app and push the contents of this repository\n\n```sh\nheroku create\ngit push heroku main\n```\n\nCreate the Redis addon, note that this can take a few minutes to start.\n\n```sh\nheroku addons:create heroku-redis:hobby-dev\n```\n\nYou can check the status of the addon with the following command. The app will not work until the addon has been successfully created.\n\n```sh\nheroku addons:info heroku-redis\n```\n\nAdd a worker to handle the background tasks.\n\n```sh\nheroku scale worker=1\n```\n\nOpen the deployed app in your browser\n\n```sh\nheroku open\n```\n\n## Contributing\n\nIf something is unclear or you find a bug feel free to submit an issue or pull\nrequest.\n\n[deploy-endpoint]: https://heroku.com/deploy?template=https://github.com/tcbegley/dash-rq-demo\n[docker]: https://www.docker.com/\n[heroku]: https://www.heroku.com/\n[heroku-cli]: https://devcenter.heroku.com/articles/heroku-cli\n[python37]: https://www.python.org/\n[redis]: https://redis.io/\n[redis-server]: https://redis.io/topics/quickstart#starting-redis\n[rq-docs]: https://python-rq.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcbegley%2Fdash-rq-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcbegley%2Fdash-rq-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcbegley%2Fdash-rq-demo/lists"}