{"id":13502468,"url":"https://github.com/marksteve/flask-beanstalk","last_synced_at":"2025-07-26T17:06:12.895Z","repository":{"id":8975855,"uuid":"10719799","full_name":"marksteve/flask-beanstalk","owner":"marksteve","description":"Utilities for using Beanstalk with Flask","archived":false,"fork":false,"pushed_at":"2015-09-11T07:27:54.000Z","size":151,"stargazers_count":3,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-27T13:51:36.815Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/marksteve.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2013-06-16T12:29:17.000Z","updated_at":"2015-09-10T00:51:47.000Z","dependencies_parsed_at":"2022-09-10T01:51:57.853Z","dependency_job_id":null,"html_url":"https://github.com/marksteve/flask-beanstalk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marksteve/flask-beanstalk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fflask-beanstalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fflask-beanstalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fflask-beanstalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fflask-beanstalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marksteve","download_url":"https://codeload.github.com/marksteve/flask-beanstalk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marksteve%2Fflask-beanstalk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267198674,"owners_count":24051559,"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-07-26T02:00:08.937Z","response_time":62,"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":"2024-07-31T22:02:14.985Z","updated_at":"2025-07-26T17:06:12.879Z","avatar_url":"https://github.com/marksteve.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"===============\nFlask-Beanstalk\n===============\n\n.. image:: http://img.shields.io/pypi/v/Flask-Beanstalk.png\n\nUtilities for using Beanstalk with Flask\n\n------\nClient\n------\n\n``flask_beanstalk.Beanstalk`` is a simple wrapper for ``beanstalkc.Connection``\nthat allows reading configuration from ``app.config``.\n\n::\n\n  from flask import Flask\n  from flask_beanstalk import Beanstalk\n\n  app = Flask(__name__)\n  beanstalk = Beanstalk(app)  # or beanstalk.init_app(app)\n\nConfiguration\n=============\n\n::\n\n  app.config['BEANSTALK_HOST']\n  app.config['BEANSTALK_PORT']\n  app.config['BEANSTALK_PARSE_YAML']\n  app.config['BEANSTALK_CONN_TIMEOUT']\n\n------\nWorker\n------\n\nDefine and spawn workers by subclassing from ``flask_beanstalk.Worker``.\n``flask_beanstalk.Worker`` inherits from ``gevent.Greenlet`` but ``gevent``\nis an optional dependency in case you just want to use the client.\n\n::\n\n  import gevent\n  from flask_beanstalk import Worker as _Worker\n\n  class Worker(_Worker):\n    def run(self, job):\n      self._logger.info('Received: %r' % job.body)\n      job.delete()\n\n  workers = Worker.spawn_workers(10)\n  try:\n    while True:\n      gevent.sleep(10000)\n  except KeyboardInterrupt:\n    Worker.stop_workers(workers)\n\n----------\nTry it out\n----------\n\nInstall and run ``beanstalkd`` if you haven't done so yet.\n\n::\n\n  git clone https://github.com/marksteve/flask-beanstalk.git\n  cd flask-beanstalk\n  mkvirtualenv flask-beanstalk\n  workon flask-beanstalk\n  python setup.py develop\n  python example_worker.py\n\nOn another terminal::\n\n  workon flask-beanstalk\n  python example.py\n\nGo to localhost:5000 in your browser to send a job.\nThe worker should be able to accept and process it.\nTry to send multiple jobs before sending a SIGINT\nto the worker. Jobs being worked on should be\nprocessed first before the worker shuts down.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksteve%2Fflask-beanstalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarksteve%2Fflask-beanstalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksteve%2Fflask-beanstalk/lists"}