{"id":14972873,"url":"https://github.com/joshblum/beanstalk-dispatch","last_synced_at":"2026-03-06T20:03:17.351Z","repository":{"id":57414433,"uuid":"108480983","full_name":"joshblum/beanstalk-dispatch","owner":"joshblum","description":"Django application to schedule and run functions on an AWS SQS queue.","archived":false,"fork":false,"pushed_at":"2025-10-23T18:46:12.000Z","size":40,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-23T20:25:45.040Z","etag":null,"topics":["beanstalk","beanstalk-worker","django","django-application","sqs-queue"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshblum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-10-27T00:43:35.000Z","updated_at":"2025-10-23T18:43:51.000Z","dependencies_parsed_at":"2025-10-23T20:19:15.919Z","dependency_job_id":"705ef913-82a6-4755-9f77-634d13070482","html_url":"https://github.com/joshblum/beanstalk-dispatch","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/joshblum/beanstalk-dispatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshblum%2Fbeanstalk-dispatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshblum%2Fbeanstalk-dispatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshblum%2Fbeanstalk-dispatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshblum%2Fbeanstalk-dispatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshblum","download_url":"https://codeload.github.com/joshblum/beanstalk-dispatch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshblum%2Fbeanstalk-dispatch/sbom","scorecard":{"id":533843,"data":{"date":"2025-08-11","repo":{"name":"github.com/joshblum/beanstalk-dispatch","commit":"bdfff18b2d3503dab36386141174bed3a40bd7d3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":4,"reason":"5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 2/15 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/joshblum/beanstalk-dispatch/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/joshblum/beanstalk-dispatch/ci.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"43 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2014-5 / GHSA-296w-6qhq-gf92","Warn: Project is vulnerable to: PYSEC-2011-2 / GHSA-3jqw-crqj-w8qw","Warn: Project is vulnerable to: PYSEC-2012-3 / GHSA-59w8-4wm2-4xw8","Warn: Project is vulnerable to: PYSEC-2012-4 / GHSA-5h2q-4hrp-v9rr","Warn: Project is vulnerable to: PYSEC-2014-6 / GHSA-625g-gx8c-xcmg","Warn: Project is vulnerable to: PYSEC-2015-8 / GHSA-6565-fg86-6jcx","Warn: Project is vulnerable to: PYSEC-2021-98 / GHSA-68w8-qjq3-2gfm","Warn: Project is vulnerable to: PYSEC-2012-2 / GHSA-78vx-ggch-wghm","Warn: Project is vulnerable to: PYSEC-2015-9 / GHSA-7fq8-4pv5-5w5c","Warn: Project is vulnerable to: PYSEC-2015-4 / GHSA-7qfw-j7hp-v45g","Warn: Project is vulnerable to: PYSEC-2011-9 / GHSA-7wph-fc4w-wqp2","Warn: Project is vulnerable to: GHSA-7xr5-9hcq-chf9","Warn: Project is vulnerable to: PYSEC-2014-2 / GHSA-89hj-xfx5-7q66","Warn: Project is vulnerable to: GHSA-8x94-hmjh-97hq","Warn: Project is vulnerable to: PYSEC-2016-2 / GHSA-c8c8-9472-w52h","Warn: Project is vulnerable to: PYSEC-2016-3 / GHSA-crhm-qpjc-cm64","Warn: Project is vulnerable to: PYSEC-2014-4 / GHSA-f7cm-ccfp-3q4r","Warn: Project is vulnerable to: PYSEC-2016-16 / GHSA-fp6p-5xvw-m74f","Warn: Project is vulnerable to: PYSEC-2011-8 / GHSA-fwr5-q9rx-294f","Warn: Project is vulnerable to: PYSEC-2015-5 / GHSA-gv98-g628-m9x5","Warn: Project is vulnerable to: PYSEC-2015-20 / GHSA-h582-2pch-3xv3","Warn: Project is vulnerable to: PYSEC-2011-5 / GHSA-h95j-h2rv-qrg4","Warn: Project is vulnerable to: GHSA-hmr4-m2h5-33qx","Warn: Project is vulnerable to: PYSEC-2015-6 / GHSA-jhjg-w2cp-5j44","Warn: Project is vulnerable to: PYSEC-2016-15 / GHSA-pw27-w7w4-9qc7","Warn: Project is vulnerable to: PYSEC-2015-10 / GHSA-q5qw-4364-5hhm","Warn: Project is vulnerable to: PYSEC-2011-4 / GHSA-rm2j-x595-q9cj","Warn: Project is vulnerable to: GHSA-rrqc-c2jx-6jgv","Warn: Project is vulnerable to: PYSEC-2014-1 / GHSA-rvq6-mrpv-m6rm","Warn: Project is vulnerable to: PYSEC-2014-7 / GHSA-rw75-m7gp-92m3","Warn: Project is vulnerable to: PYSEC-2019-16 / GHSA-vfq6-hq5r-27r6","Warn: Project is vulnerable to: PYSEC-2014-3 / GHSA-wqjj-hx84-v449","Warn: Project is vulnerable to: PYSEC-2011-3 / GHSA-wxg3-mfph-qg9w","Warn: Project is vulnerable to: PYSEC-2011-1 / GHSA-x88j-93vc-wpmp","Warn: Project is vulnerable to: PYSEC-2007-1","Warn: Project is vulnerable to: PYSEC-2008-1","Warn: Project is vulnerable to: PYSEC-2008-2","Warn: Project is vulnerable to: PYSEC-2009-3","Warn: Project is vulnerable to: PYSEC-2015-11","Warn: Project is vulnerable to: PYSEC-2015-7","Warn: Project is vulnerable to: PYSEC-2016-18","Warn: Project is vulnerable to: PYSEC-2022-304"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T06:25:00.425Z","repository_id":57414433,"created_at":"2025-08-20T06:25:00.425Z","updated_at":"2025-08-20T06:25:00.425Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30195568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["beanstalk","beanstalk-worker","django","django-application","sqs-queue"],"created_at":"2024-09-24T13:47:40.343Z","updated_at":"2026-03-06T20:03:17.343Z","avatar_url":"https://github.com/joshblum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# beanstalk-dispatch\n\n[![PyPI version](https://badge.fury.io/py/beanstalk-dispatch.svg?maxAge=2592000)](https://badge.fury.io/py/beanstalk-dispatch)\n[![PyPI](https://img.shields.io/pypi/pyversions/beanstalk-dispatch.svg)](https://pypi.python.org/pypi/beanstalk-dispatch)\n[![Github Actions](https://github.com/joshblum/beanstalk-dispatch/actions/workflows/ci.yml/badge.svg)](https://github.com/joshblum/beanstalk-dispatch/actions)\n\n`beanstalk-dispatch` is a Django application that runs functions that have been\nscheduled to run an [AWS SQS](https://aws.amazon.com/sqs/) queue and executes\nthem on [Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/) Worker\nmachines that are listening to that queue.\n\nThis application was originally written by [@marcua](https://github.com/marcua)\nfor [@b12io](https://github.com/b12io)'s open source application\n[orchestra](https://github.com/b12io/orchestra).\n\nThe library supports Django 4 to Django 5.2 across Python versions 3.10 to\n3.12. If you would like to see a feature or find a bug, please let me know by\nopening an [issue](https://github.com/joshblum/beanstalk-dispatch/issues) or\n[pull request](https://github.com/joshblum/beanstalk-dispatch/pulls).\n\n## Getting started in 5 minutes\n\nTo install:\n\n```\npip install beanstalk-dispatch\n```\n\n- create an Elastic Beanstalk environment for an application\n  that has the following two parameters in `settings.py`:\n\n```python\n     BEANSTALK_DISPATCH_SQS_KEY = 'your AWS key for accessing SQS'\n     BEANSTALK_DISPATCH_SQS_SECRET = 'your AWS secret for accessing SQS'\n```\n\n- Add `beanstalk_dispatch` to settings.py's `INSTALLED_APPS`\n\n```python\nINSTALLED_APPS = (\n    # ...other installed applications...\n    'beanstalk_dispatch',\n)\n```\n\n- Add `url(r'^beanstalk_dispatch/', include('beanstalk_dispatch.urls')),` to\n  your main `urls.py`\n\n- Add `/beanstalk_dispatch/dispatcher` as the HTTP endpoint or your beanstalk\n  worker configuration in the AWS console.\n\n- Add a dispatch table. The dispatcher works by creating an HTTP endpoint\n  that a local SQS/Beanstalk daemon POSTs requests to. That endpoint\n  consults a `BEANSTALK_DISPATCH_TABLE`, which maps function names onto\n  functions to run. Here's an example:\n\n```python\n      if os.environ.get('BEANSTALK_WORKER') == 'True':\n        BEANSTALK_DISPATCH_TABLE = {\n            'a_function_to_dispatch': ('some_package.beanstalk_tasks.'\n                                      'the_name_of_the_function_in_the_module')\n        }\n```\n\nThe first line is a check we have that ensures this type of machine should\nbe a beanstalk worker. We set a `BEANSTALK_WORKER` environment variable to\n`'True'` in the environment's configuration only on our worker machines.\nThis avoids other environments (e.g., our web servers) from serving as open\nproxies for running arbitrary code.\n\nThe second line is the dispatch table. It maps a path to the function to be\nexecuted.\n\n## Scheduling a function to run\n\nThe `beanstalk_dispatch.client.schedule_function` schedules a function to run\non a given SQS queue. The function name you pass it must be a key in the\n`BEANSTALK_DISPATCH_TABLE`, and the `queue_name` you pass it must be a queue\nfor which a beanstalk worker is configured.\n\n```python\nfrom beanstalk_dispatch.client import schedule_function\n\nschedule_function('a-queue', 'a_function_to_dispatch',\n    '1', '2', kwarg1=1, kwarg2=2)\n```\n\n## SafeTasks\n\nBy default, every function run by `beanstalk_dispatch` is wrapped in a\n`SafeTask` class that sets a `@timeout` decorator on the function and catches\nany exceptions for logging. If you would like to customize the behavior of the\n`SafeTask`, create a subclass and reference this object in\n`BEANSTALK_DISPATCH_TABLE`.\n\nThe following parameters/functions are configurable on a `SafeTask`\n\n`timeout_timedelta`: maximum number of seconds task can run, defaults to `2`\nminutes.\n`verbose`: boolean specifying if failures are logged, defaults to `False`.\n`run`: abstract method to fill in with task work.\n`on_error`: a function that runs if the task fails for any reason.\n`on_success`: a function that runs after the task completes successfully.\n`on_completion`: a function that runs after each task (after `on_error` or\n`on_success`).\n\nFor example:\n\n```python\n# beanstalk_tasks.py\nfrom datetime import timedelta\n\nfrom beanstalk_dispatch.client import schedule_function\nfrom beanstalk_dispatch.safe_task import SafeTask\n\nclass MySafeTask(SafeTask):\n\n    timeout_timedelta = timedelta(seconds=1000)\n    verbose = True\n\n    def run(self, *args, **kwargs):\n        # Run the task\n        print('Running task')\n\n    def on_error(self, e, *args, **kwargs):\n        print('There was an error {}'.format(e))\n\n    def on_success(self, *args, **kwargs):\n        print('Success!')\n\n    def on_completion(self, *args, **kwargs):\n        print('Task completed')\n\nschedule_function('a-queue', 'mysafetask',\n    '1', '2', kwarg1=1, kwarg2=2)\n```\n\n```\n# settings.py\n  if os.environ.get('BEANSTALK_WORKER') == 'True':\n    BEANSTALK_DISPATCH_TABLE = {\n        'mysafetask': 'beanstalk_tasks.MySafeTask'\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshblum%2Fbeanstalk-dispatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshblum%2Fbeanstalk-dispatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshblum%2Fbeanstalk-dispatch/lists"}