{ "info": { "author": "Kimi Huang", "author_email": "kimi.huang@brightcells.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-beanstalkd\n=================\n\n*django-beanstalkd* is a convenience wrapper for the [beanstalkd][beanstalkd]\n[Python Bindings][beanstalkc].\n\nWith django-beanstalkd, you can code jobs as well as clients in a Django project\nwith minimal overhead in your application. Server connections etc. all take\nplace in django-beanstalkd and don't unnecessarily clog your application code.\n\nThis library is based in large part on Fred Wenzel's [django-gearman][django-gearman].\nIf you're looking for synchronous execution of jobs, check out [Gearman][gearman]\nand Fred's library! Beanstalkd is useful for background processes only.\n\n[beanstalkd]: http://kr.github.com/beanstalkd/\n[beanstalkc]: http://github.com/earl/beanstalkc/\n[gearman]: http://gearman.org/\n[django-gearman]: http://github.com/fwenzel/django-gearman\n\nInstallation\n------------\nIt's the same for both the client and worker instances of your django project:\n\n pip install django-beanstalkd\n\nAdd ``django_beanstalkd`` to the `INSTALLED_APPS` section of `settings.py`.\n\nSpecify the following settings in your local settings.py file if your beanstalkd\nserver isn't accessible on port 11300 of localhost (127.0.0.1):\n\n # My beanstalkd server\n BEANSTALK_SERVER = '127.0.0.1:11300' # the default value\n\nIf necessary, you can specify a pattern to be applied to your beanstalk worker\nfunctions:\n\n # beanstalk job name pattern. Namespacing etc goes here. This is the pattern\n # your jobs will register as with the server, and that you'll need to use\n # when calling them from a non-django-beanstalkd client.\n # replacement patterns are:\n # %(app)s : django app name the job is filed under\n # %(job)s : job name\n BEANSTALK_JOB_NAME = '%(app)s.%(job)s'\n\n\nWorkers\n-------\n### Registering jobs\nCreate a file `beanstalk_jobs.py` in any of your django apps, and define as many\njobs as functions as you like. The job must accept a single string argument as\npassed by the caller.\n\nMark each of these functions as beanstalk jobs by decorating them with\n`django_beanstalkd.beanstalk_job`.\n\nFor an example, look at the `beanstalk_example` app's `benstalk_jobs.py` file.\n\n### Starting a worker\nTo start a worker, run `python manage.py beanstalk_worker`. It will start\nserving all registered jobs.\n\nTo spawn more than one worker (if, e.g., most of your jobs are I/O bound),\nuse the `-w` option:\n\n python manage.py beanstalk_worker -w 5\n\nwill start five workers.\n\nSince the process will keep running while waiting for and executing jobs,\nyou probably want to run this in a _screen_ session or similar.\n\nClients\n-------\nTo make your workers work, you need a client app passing data to them. Create\nand instance of the `django_beanstalkd.BeanstalkClient` class and `call` a\nfunction with it:\n\n from django_beanstalkd import BeanstalkClient\n client = BeanstalkClient()\n client.call('beanstalk_example.background_counting', '5')\n\nFor a live example look at the `beanstalk_example` app, in the\n`management/commands/beanstalk_example_client.py` file. Arguments to `call` are\n\n priority: an integer number that specifies the priority. Jobs with a\n smaller priority get executed first\n delay: how many seconds to wait before the job can be reserved\n ttr: how many seconds a worker has to process the job before it gets requeued\n\n\nExample App\n-----------\nFor a full, working, example application, add `beanstalk_example` to your\n`INSTALLED_APPS`, then run a worker in one shell:\n\n python manage.py beanstalk_worker -w 4\n\nand execute the example app in another:\n\n python manage.py beanstalk_example_client\n\nYou can see the client sending data and the worker(s) working on it.\n\nLicensing\n---------\nThis software is licensed under the [Mozilla Tri-License][MPL]:\n\n ***** BEGIN LICENSE BLOCK *****\n Version: MPL 1.1/GPL 2.0/LGPL 2.1\n\n The contents of this file are subject to the Mozilla Public License Version\n 1.1 (the \"License\"); you may not use this file except in compliance with\n the License. You may obtain a copy of the License at\n http://www.mozilla.org/MPL/\n\n Software distributed under the License is distributed on an \"AS IS\" basis,\n WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n for the specific language governing rights and limitations under the\n License.\n\n The Original Code is django-gearman.\n\n The Initial Developer of the Original Code is Mozilla.\n Portions created by the Initial Developer are Copyright (C) 2010\n the Initial Developer. All Rights Reserved.\n\n Contributor(s):\n Jonas VP \n Frederic Wenzel \n Jeff Balogh \n Kimi Huang \n\n Alternatively, the contents of this file may be used under the terms of\n either the GNU General Public License Version 2 or later (the \"GPL\"), or\n the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n in which case the provisions of the GPL or the LGPL are applicable instead\n of those above. If you wish to allow use of your version of this file only\n under the terms of either the GPL or the LGPL, and not to allow others to\n use your version of this file under the terms of the MPL, indicate your\n decision by deleting the provisions above and replace them with the notice\n and other provisions required by the GPL or the LGPL. If you do not delete\n the provisions above, a recipient may use your version of this file under\n the terms of any one of the MPL, the GPL or the LGPL.\n\n ***** END LICENSE BLOCK *****\n\n[MPL]: http://www.mozilla.org/MPL/\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/beanstalkdclub/django-beanstalkd", "keywords": "", "license": "MPL", "maintainer": "", "maintainer_email": "", "name": "django-beanstalkd", "package_url": "https://pypi.org/project/django-beanstalkd/", "platform": "", "project_url": "https://pypi.org/project/django-beanstalkd/", "project_urls": { "Homepage": "https://github.com/beanstalkdclub/django-beanstalkd" }, "release_url": "https://pypi.org/project/django-beanstalkd/1.0.1/", "requires_dist": [ "beanstalkc", "django-six", "pyyaml" ], "requires_python": "", "summary": "A convenience wrapper for beanstalkd clients and workers in Django using the beanstalkc library for Python", "version": "1.0.1" }, "last_serial": 2495431, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "700c64d4cbdae7c2774beea3050d7842", "sha256": "dee23e59a4791565a356da45adfe5a16ec8e097f56d4fcda4bc380a5c5768bf2" }, "downloads": -1, "filename": "django-beanstalkd-0.2.tar.gz", "has_sig": false, "md5_digest": "700c64d4cbdae7c2774beea3050d7842", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6719, "upload_time": "2011-03-16T04:36:14", "url": "https://files.pythonhosted.org/packages/5f/5f/afb2b8984cc511be2ffd14b3fb2b4ba051e46597d9565b79532a3730e23a/django-beanstalkd-0.2.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "999e759be97236848954c7d4aba3dccd", "sha256": "628510baaa47e0d4e8288f0a2a01c0f7ffd791c9cf9e5ce0a723220c32ca951d" }, "downloads": -1, "filename": "django_beanstalkd-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "999e759be97236848954c7d4aba3dccd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12381, "upload_time": "2016-12-02T09:17:22", "url": "https://files.pythonhosted.org/packages/00/2b/430ecea5b1d7e1875419e1674061f7204c195fe57e91ace44ae0894e8afe/django_beanstalkd-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2245b5043dc89a85dbdd686f52e1338", "sha256": "21096f2def656f8047d5b3308a48a675c71e81a30311f8189263c0dea26bc93d" }, "downloads": -1, "filename": "django-beanstalkd-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e2245b5043dc89a85dbdd686f52e1338", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7076, "upload_time": "2016-12-02T09:17:25", "url": "https://files.pythonhosted.org/packages/bb/98/8d9b4d0ba5e9d3d37b9be887a7d0ddf96d08356e2553cb599fb5c7cd6578/django-beanstalkd-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "999e759be97236848954c7d4aba3dccd", "sha256": "628510baaa47e0d4e8288f0a2a01c0f7ffd791c9cf9e5ce0a723220c32ca951d" }, "downloads": -1, "filename": "django_beanstalkd-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "999e759be97236848954c7d4aba3dccd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12381, "upload_time": "2016-12-02T09:17:22", "url": "https://files.pythonhosted.org/packages/00/2b/430ecea5b1d7e1875419e1674061f7204c195fe57e91ace44ae0894e8afe/django_beanstalkd-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2245b5043dc89a85dbdd686f52e1338", "sha256": "21096f2def656f8047d5b3308a48a675c71e81a30311f8189263c0dea26bc93d" }, "downloads": -1, "filename": "django-beanstalkd-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e2245b5043dc89a85dbdd686f52e1338", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7076, "upload_time": "2016-12-02T09:17:25", "url": "https://files.pythonhosted.org/packages/bb/98/8d9b4d0ba5e9d3d37b9be887a7d0ddf96d08356e2553cb599fb5c7cd6578/django-beanstalkd-1.0.1.tar.gz" } ] }