{ "info": { "author": "Asko Soukka", "author_email": "asko.soukka@iki.fi", "bugtrack_url": null, "classifiers": [ "Framework :: Plone :: 4.3", "Programming Language :: Python", "Programming Language :: Python :: 2.7" ], "description": "collective.futures\n==================\n\n.. image:: https://secure.travis-ci.org/datakurre/collective.futures.png\n :target: http://travis-ci.org/datakurre/collective.futures\n\nThis is a collective package for providing yet another\nway to do asynchronous (non-blocking) processing on Plone.\n\nThis time we speak in terms of promises and futures:\npromises are asynchronously run functions, which provide\ntheir results as requested futures for add-on your code.\n\nA major differences for any other alternatives is that this\ndoes not require any additional services, but requires only\nPlone running on top of a Zope instance.\n\nA major limitation is that the asynchronously executed\ncode cannot access the database in any way (or you may\nface unexpected consequences). Also, this brings no benefits\nwith HAProxy and fixed amount current requests per instance.\n\n\nExample\n-------\n\n.. code:: python\n\n from Products.Five.browser import BrowserView\n\n from collective import futures\n\n\n def my_async_task(*args):\n # a lot of time consuming async processing\n return u'my asynchronously computed value'\n\n\n class MyView(BrowserView):\n\n def __call__(self, *args):\n try:\n return futures.result('my_unique_key')\n except futures.FutureNotSubmittedError:\n futures.submit('my_unique_key', my_async_task, *args)\n return u'just a placeholder value'\n\nor\n\n.. code:: python\n\n from Products.Five.browser import BrowserView\n\n from collective import futures\n\n\n def my_async_task(*args):\n # a lot of time consuming async processing\n return u'my asynchronously computed value'\n\n\n class MyView(BrowserView):\n\n def __call__(self, *args):\n return futures.resultOrSubmit(\n 'my_unique_key', u'placeholder value', my_async_task, *args)\n\n\nExplanation\n-----------\n\nThis package uses approach, which kind of splits a single\nrequest into two separate passes:\n\nWhenever some add-on code\nrequires a value to be computed asynchronously, it\ntries to request for a named future result at first and only then\nsubmits a promise function to compute result for that future.\n\nIf any futures are submitted, the initial response is never\npublished, but instead the current transaction is aborted\nand the submitted promise functions are executed in\nparallel threads separate from the default Zope threads\n(or even in parallel processes) and\ntheir return values are collected\n(see also the documentation of ``concurrent.futures`` in Python).\n\nWhen all promise functions have been resolved, the original request\nis cloned, resolved values are set as futures and a new\ninternal request is dispatched.\n\nAfter this second pass, the add-on code can use\nthe now available futures, not submit more futures, and\nfinally, the response is published all the way to\nthe browser.\n\n-----\n\nFor more background information: http://datakurre.pandala.org/2014/05/asynchronous-stream-iterators-and.html\n\nChangelog\n=========\n\n0.9.3 (2018-09-05)\n------------------\n\n- Fix issue where plone.protect tried to parse PromiseWorkerStreamIterator as\n xml\n [datakurre]\n\n0.9.2 (2018-06-29)\n------------------\n\n- Add to log exceptions within futures to get full exception stacktraces\n [datakurre]\n\n0.9.1 (2016-05-25)\n------------------\n\n- Fix issue where resolved futures were not passed for nested requests\n [datakurre]\n\n0.9.0 (2014-10-23)\n------------------\n\n- First release.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/collective/collective.futures/", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "collective.futures", "package_url": "https://pypi.org/project/collective.futures/", "platform": "", "project_url": "https://pypi.org/project/collective.futures/", "project_urls": { "Homepage": "https://github.com/collective/collective.futures/" }, "release_url": "https://pypi.org/project/collective.futures/0.9.3/", "requires_dist": [ "setuptools", "futures", "Products.CMFPlone", "zope.globalrequest", "plone.transformchain", "unittest2; extra == 'test'", "plone.app.testing; extra == 'test'", "plone.app.robotframework; extra == 'test'" ], "requires_python": "", "summary": "Experimental non-blocking futures for Plone", "version": "0.9.3" }, "last_serial": 4241047, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "9e776de309a6fa92f062cd7148047a8f", "sha256": "b1cc40d17b64f63f894c1a484bb6e4d2f94aaa0957684c34418eb79f07358f33" }, "downloads": -1, "filename": "collective.futures-0.9.0.zip", "has_sig": false, "md5_digest": "9e776de309a6fa92f062cd7148047a8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20126, "upload_time": "2014-10-22T22:38:14", "url": "https://files.pythonhosted.org/packages/ee/d9/f15612aee4e747a6bb6c672607dd01f80277d02f2ee422ab99a56f40aa2a/collective.futures-0.9.0.zip" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "4ae16b3f8c712727ab74f4d9f3174ff6", "sha256": "99f4faced8cbed2683f80a0a96f090bf6d7d58fe0c8e77cdc704e76bd2795ec0" }, "downloads": -1, "filename": "collective.futures-0.9.1.tar.gz", "has_sig": false, "md5_digest": "4ae16b3f8c712727ab74f4d9f3174ff6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11054, "upload_time": "2016-05-25T12:41:07", "url": "https://files.pythonhosted.org/packages/3a/5d/45ef41b8dd5e46f2f290744f306066b9c4cb6f8e0b456fe88cadf03c82ec/collective.futures-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "18035eb9867e2500fb2b2ac48fc39839", "sha256": "ab7d8bd0acb656c0cbdca588c3210b6a272fc65279d1fceb3f34dbe189527744" }, "downloads": -1, "filename": "collective.futures-0.9.2-py2-none-any.whl", "has_sig": false, "md5_digest": "18035eb9867e2500fb2b2ac48fc39839", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15562, "upload_time": "2018-06-29T11:26:01", "url": "https://files.pythonhosted.org/packages/d3/17/2fb20651ffe38ff02a3b4c0f503bd771afa48182adb7162830deb6d9889d/collective.futures-0.9.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bdd6451d4dcc4e96df0e009523d1339c", "sha256": "243e70c6868764622e75d045d12e8d2fc0561e4464b5a45692bac80daaba8e3e" }, "downloads": -1, "filename": "collective.futures-0.9.2.tar.gz", "has_sig": false, "md5_digest": "bdd6451d4dcc4e96df0e009523d1339c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8952, "upload_time": "2018-06-29T11:26:02", "url": "https://files.pythonhosted.org/packages/52/0f/ca4f6b3b7982d6e1e64c5e89796690221e319bb0aa4f0c36209fbe80dee8/collective.futures-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "b78cefa02884bdad0387813d8924f874", "sha256": "62af75ba41b6e92cd7e603058fbb02ab15d07de7cf5812882976cf80e9afa22c" }, "downloads": -1, "filename": "collective.futures-0.9.3-py2-none-any.whl", "has_sig": false, "md5_digest": "b78cefa02884bdad0387813d8924f874", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15660, "upload_time": "2018-09-05T13:59:41", "url": "https://files.pythonhosted.org/packages/97/bc/8a9fd18c7e4f4ec3a34f7012e5635f6063dfadf08d0fb7c3c8220daf3f39/collective.futures-0.9.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7c6eab2fd78ec2593e4898c6b1de9b16", "sha256": "d81bcf5048692352c31aaa62f2e08d69d6fd7b6592a6efa6a53831fff7ac5eb0" }, "downloads": -1, "filename": "collective.futures-0.9.3.tar.gz", "has_sig": false, "md5_digest": "7c6eab2fd78ec2593e4898c6b1de9b16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9028, "upload_time": "2018-09-05T13:59:42", "url": "https://files.pythonhosted.org/packages/14/89/f571196e044378a563b95c2126b27dc66b8155d17fadb8aad1383b94d95b/collective.futures-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b78cefa02884bdad0387813d8924f874", "sha256": "62af75ba41b6e92cd7e603058fbb02ab15d07de7cf5812882976cf80e9afa22c" }, "downloads": -1, "filename": "collective.futures-0.9.3-py2-none-any.whl", "has_sig": false, "md5_digest": "b78cefa02884bdad0387813d8924f874", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15660, "upload_time": "2018-09-05T13:59:41", "url": "https://files.pythonhosted.org/packages/97/bc/8a9fd18c7e4f4ec3a34f7012e5635f6063dfadf08d0fb7c3c8220daf3f39/collective.futures-0.9.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7c6eab2fd78ec2593e4898c6b1de9b16", "sha256": "d81bcf5048692352c31aaa62f2e08d69d6fd7b6592a6efa6a53831fff7ac5eb0" }, "downloads": -1, "filename": "collective.futures-0.9.3.tar.gz", "has_sig": false, "md5_digest": "7c6eab2fd78ec2593e4898c6b1de9b16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9028, "upload_time": "2018-09-05T13:59:42", "url": "https://files.pythonhosted.org/packages/14/89/f571196e044378a563b95c2126b27dc66b8155d17fadb8aad1383b94d95b/collective.futures-0.9.3.tar.gz" } ] }