{ "info": { "author": "LOGILAB S.A. (Paris, FRANCE)", "author_email": "contact@logilab.fr", "bugtrack_url": null, "classifiers": [], "description": "Summary\n-------\nasynchronous workers in your instance\n\n\nHow to use this cube\n--------------------\n\nAdd the worker cube to the dependencies of your cube. In your schema,\nextend the cube's schema if necessary. Common extension often involve\nadding attributes and relations to the CWWorkerTask entity which will\nbear information pertaining to the task (data, relations to other\nentities in the database...).\n\nThen extend the CWWorker entity class. It is meant to have ``do_xxxx``\nmethods, where ``xxxx`` matches the value of the operation attribute\nof CWWorkerTask entities. These methods are called with 2 arguments: a\nsession and a task. You generally use the task to get additional\nparameters about what needs to be done. The method should return a\nUnicode string which will be used as a message in the transition\ninformation for the CWWorkerTask.\n\nHere is an example of a CWWorker method which will asynchronously\ndelete an entity from the database, this is interesting in case the\nentity has many composite relations and its deletion will trigger\nlengthy chained deletions. The entity is at the end of an added\nCWWorkerTask relation called ``target``::\n\n def do_delete_entity(self, session, task):\n entity = task.target[0]\n session.execute('DELETE Any X WHERE X eid %(eid)s', {'eid': entity.eid})\n return _('Success')\n\nTo trigger the deletion, all you need to do is to create a\nCWWorkerTask with the correct operation and target (which in this case\nmay require overriding cubicweb.web.views.editforms.DeleteConfFormView\nand setting up a custom Controller)::\n\n task = self._cw.create_entity('CWWorkerTask', \n operation=u'delete_entity', \n target=some_entity)\n\n\n\nInstance setup\n--------------\n\nYou need to configure your instance to start the worker. This is done\nby setting ``long-transaction-worker`` to True in your instance\nconfiguration file (this is in the ``[WORKER]`` section). This will\nstart a periodic task (you can also configure the period with\n``worker-polling-period``) which will look for pending tasks in the\ndatabase. When a task is found, the worker will grab it and start\nworking on it. The ``worker-max-load`` option sets the maximum number\nof tasks that can be run simultaneously by a worker. It defaults to 2\nand you may want to set it to 1, but setting higher values will\ndegrade performances.\n\nYou can setup your instance as usual and configure it with a worker,\nbut the efficient way of doing things is to setup 2 instances (or\nmore) sharing a common database. The first instance will have the\n``long-transaction-worker`` option set to False and will concentrate\non web serving, and will create new ``CWWorkerTask``. The other\ninstances can be repository only (i.e. ``cubicweb-ctl create -c\nrepository -a somecube myworkerinstance``) and will have\n``long-transaction-worker`` set to True. That will ensure that the\nworkers and the web serving processes are not fighting over Python's\nGlobal Interpreter Lock and provide maximum performance.\n\nNote about connections pool size: each task processed by a worker\ncan use typically up to 3 connection from the pool. If you are running\na worker in the same instance as the one which does web serving, you\nwill probably need to set a larger ``connections-pool-size`` value\nthan the default (4): 7 or 8 should be fine.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.cubicweb.org/project/cubicweb-worker", "keywords": null, "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "cubicweb-worker", "package_url": "https://pypi.org/project/cubicweb-worker/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cubicweb-worker/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.cubicweb.org/project/cubicweb-worker" }, "release_url": "https://pypi.org/project/cubicweb-worker/3.2.0/", "requires_dist": null, "requires_python": null, "summary": "asynchronous workers in your instance", "version": "3.2.0" }, "last_serial": 1598861, "releases": { "3.0.0": [ { "comment_text": "", "digests": { "md5": "34899c2af78385bf3bda32fd2a17017f", "sha256": "bd2cce004015ae154004567f633cbbb8b95d6ae31379d689975e45ab5d0a926c" }, "downloads": -1, "filename": "cubicweb-worker-3.0.0.tar.gz", "has_sig": false, "md5_digest": "34899c2af78385bf3bda32fd2a17017f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14031, "upload_time": "2013-12-18T16:38:20", "url": "https://files.pythonhosted.org/packages/b1/cb/6cf0ccbeb2286d40b001e0a27ae665f415a8eca78f31c0012b5b668597f8/cubicweb-worker-3.0.0.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "0b16a862bbdb4b559e823f48230241da", "sha256": "ad7112d347a12859dee014ad30d4d6d753def76de332322d740c184d941e9c5c" }, "downloads": -1, "filename": "cubicweb-worker-3.0.1.tar.gz", "has_sig": false, "md5_digest": "0b16a862bbdb4b559e823f48230241da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13916, "upload_time": "2014-07-02T14:35:05", "url": "https://files.pythonhosted.org/packages/81/04/ab4467a9196040206b8a626d4267541c6bd944e7687f52d98a5d956b62ae/cubicweb-worker-3.0.1.tar.gz" } ], "3.0.2": [ { "comment_text": "", "digests": { "md5": "f009473eefd0d2859ea81a6f57ca2e5c", "sha256": "44519ef2fc87fae8dfa9b00081f9f0fa6dfd31c8a8b0e8167162b724efa069b5" }, "downloads": -1, "filename": "cubicweb-worker-3.0.2.tar.gz", "has_sig": false, "md5_digest": "f009473eefd0d2859ea81a6f57ca2e5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13959, "upload_time": "2014-07-08T14:17:21", "url": "https://files.pythonhosted.org/packages/c7/d0/099b5ae452aafbcabfc0040bef2e8b42ae1b46c2f56d451dcaa95e1605af/cubicweb-worker-3.0.2.tar.gz" } ], "3.0.3": [ { "comment_text": "", "digests": { "md5": "88ae6381c86dfe57ff75189b3158382d", "sha256": "4527794cdbdf61cc05cb1709714c0133076b994c6c4908834088ea89765fb864" }, "downloads": -1, "filename": "cubicweb-worker-3.0.3.tar.gz", "has_sig": false, "md5_digest": "88ae6381c86dfe57ff75189b3158382d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14683, "upload_time": "2014-09-17T13:07:08", "url": "https://files.pythonhosted.org/packages/1c/d4/eb196afc2ad3eed940174d7088ea166341de3ed7a097fd2b196181370575/cubicweb-worker-3.0.3.tar.gz" } ], "3.0.4": [ { "comment_text": "", "digests": { "md5": "bc30796085485bbc131ea2b835134197", "sha256": "85f58d6b824bf4cfc6fadc8e292046f8fd2419c4209ed26b94ed48e34dd5b227" }, "downloads": -1, "filename": "cubicweb-worker-3.0.4.tar.gz", "has_sig": false, "md5_digest": "bc30796085485bbc131ea2b835134197", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14683, "upload_time": "2014-10-13T16:03:03", "url": "https://files.pythonhosted.org/packages/d7/c6/712a512c0613b135d7144a6b902c0891081bece3065eaa7ef10499b1dfe4/cubicweb-worker-3.0.4.tar.gz" } ], "3.0.5": [ { "comment_text": "", "digests": { "md5": "bf9299994c37d3e76ef2a85cfeb3ab7a", "sha256": "b7a2b2f1d3ab4924e73ca16d51eb722c7dda9750e4bbcb87b3a2700a525bb751" }, "downloads": -1, "filename": "cubicweb-worker-3.0.5.tar.gz", "has_sig": false, "md5_digest": "bf9299994c37d3e76ef2a85cfeb3ab7a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14935, "upload_time": "2015-01-30T11:45:55", "url": "https://files.pythonhosted.org/packages/f0/ee/4a922388169da142a3a122e38bb4fa6ff8aba9bdd1c23f89d7b595f51750/cubicweb-worker-3.0.5.tar.gz" } ], "3.1.0": [ { "comment_text": "", "digests": { "md5": "4b631308072c66b4b80691a412770b6d", "sha256": "7807793023e9fd5f435f067a2b7efd30250dd3de5e4517e45974c7dc6fc0da2d" }, "downloads": -1, "filename": "cubicweb-worker-3.1.0.tar.gz", "has_sig": false, "md5_digest": "4b631308072c66b4b80691a412770b6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16308, "upload_time": "2014-11-26T17:52:30", "url": "https://files.pythonhosted.org/packages/0d/cb/3574336804955dbf8a21b1e84dd547ebae7cb72788f03a96318046dff235/cubicweb-worker-3.1.0.tar.gz" } ], "3.2.0": [ { "comment_text": "", "digests": { "md5": "41d252f8967b89671b23cf30b4fffb1e", "sha256": "d52b7aaf27a6674e514e33234376d495af30b326438b99745ed1c40b971407a4" }, "downloads": -1, "filename": "cubicweb-worker-3.2.0.tar.gz", "has_sig": false, "md5_digest": "41d252f8967b89671b23cf30b4fffb1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16938, "upload_time": "2015-06-19T10:26:26", "url": "https://files.pythonhosted.org/packages/df/aa/8cb373f76300a05e253c746ab050f2020ce2fcd96d3c0457eec057a34fbd/cubicweb-worker-3.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "41d252f8967b89671b23cf30b4fffb1e", "sha256": "d52b7aaf27a6674e514e33234376d495af30b326438b99745ed1c40b971407a4" }, "downloads": -1, "filename": "cubicweb-worker-3.2.0.tar.gz", "has_sig": false, "md5_digest": "41d252f8967b89671b23cf30b4fffb1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16938, "upload_time": "2015-06-19T10:26:26", "url": "https://files.pythonhosted.org/packages/df/aa/8cb373f76300a05e253c746ab050f2020ce2fcd96d3c0457eec057a34fbd/cubicweb-worker-3.2.0.tar.gz" } ] }