{ "info": { "author": "Jason Madden", "author_email": "jason@nextthought.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: ZODB", "Intended Audience :: Developers", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "==================\n nti.transactions\n==================\n\n\n.. _transaction: https://pypi.python.org/pypi/transaction\n\n.. image:: https://coveralls.io/repos/github/NextThought/nti.transactions/badge.svg?branch=master\n\t:target: https://coveralls.io/github/NextThought/nti.transactions?branch=master\n\n.. image:: https://travis-ci.org/NextThought/nti.transactions.svg?branch=master\n :target: https://travis-ci.org/NextThought/nti.transactions\n\n.. image:: https://readthedocs.org/projects/ntitransactions/badge/?version=latest\n :target: https://ntitransactions.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\nExtensions to the `transaction`_ package.\n\nTransaction Manager\n===================\n\n``nti.transactions.transactions.TransactionsLoop`` is a retryable\ntransaction manager. It is conceptually similar to the `attempts`_\ncontext manager provided by the transaction package itself, but much\nmore powerful and extensible via subclasses. Features include:\n\n- Configurable commit vetos.\n- Extensible tests for which exceptions should be retried.\n- The ability to abort the transaction and bypass a potentially\n expensive commit when there are expected to be no side-effects.\n- Sleeping between retries.\n- Extensive logging and timing.\n\nThe TransactionLoop can be used as-is, or it can be subclassed for\ncustomization. For use in a Pyramid tween, for example, a minimal\nsubclass might look like this::\n\n >>> class PyramidTransactionLoop(TransactionLoop):\n ... def prep_for_retry(self, number, request):\n ... request.make_body_seekable()\n ... def describe_transaction(self, request):\n ... return request.url\n\nData Managers\n=============\n\nA few `data managers`_ are provided for convenience.\n\nThe first data manager is used to put an object in a ``queue``\n(something with the ``full`` and ``put_nowait`` methods) when a\ntransaction succeeds. If the queue is full, then the transaction will\nnot be allowed to commit::\n\n >>> from nti.transactions.transactions import put_nowait\n >>> put_nowait(queue, object)\n\nThis is a special case of the ``ObjectDataManager``, which will call\none method with any arguments when a transaction commits. It can be\nconfigured to vote on whether the transaction should be allowed to commit.\nor not. This is useful for, say, putting an item in a Redis queue when\nthe transaction is successful. It can be constructed directly, but the\n``do`` function is a shorthand way of joining one to the current\ntransaction::\n\n >>> from nti.transactions.transactions import do\n >>> do(print, args=(\"Committed\"))\n\n.. caution:: See the documentation of this object for numerous\n\t\t\t warnings about side-effects and its interaction with the\n\t\t\t transaction machinery. Use it with care!\n\n.. _attempts: http://zodb.readthedocs.io/en/latest/transactions.html#retrying-transactions\n.. _data managers: http://zodb.readthedocs.io/en/latest/transactions.html#data-managers\n\n=========\n Changes\n=========\n\n3.0.0 (2019-09-06)\n==================\n\n- Make ``TransactionLoop`` place its transaction manager in explicit\n mode. This can be faster and is easier to reason about, but forbids\n the called handler from manually calling ``begin()``, ``abort()`` or\n ``commit()``. See `issue 20\n `_.\n\n- Move ``transaction.begin()`` out of the block of code that is\n retried. Previously, an error there would probably be raised\n *anyway* and not retried, unless a subclass had made customizations.\n\n- Add ``setUp`` and ``tearDown`` methods to TransactionLoop to give\n subclasses a place to hook into the inners of the transaction loop.\n This is particularly helpful if they need to do something after the\n transaction manager has been put in explicit mode. See `issue 22\n `_.\n\n2.0.1 (2019-09-03)\n==================\n\n- Fix compatibility with perfmetrics 3.0: drop ``from __future__\n import unicode_literals``.\n\n\n2.0.0 (2018-07-20)\n==================\n\n- Use the new public ``isRetryableError`` in transaction 2.2. The\n interface for this package is unchanged, but a major version bump of\n a dependency necessitates a major bump here. See `issue 12\n `_.\n\n- Test support for Python 3.7; remove test support for Python 3.4.\n\n- ``TransactionLoop`` is more careful to not keep traceback objects\n around, especially on Python 2.\n\n1.1.1 (2018-07-19)\n==================\n\n- When the ``TransactionLoop`` raises a ``CommitFailedError`` from a\n ``TypeError``, it preserves the original message.\n\n- Test support for Python 3.6.\n\n1.1.0 (2017-04-17)\n==================\n\n- Add a new ObjectDataManager that will attempt to execute after\n other ObjectDataManagers.\n\n\n1.0.0 (2016-07-28)\n==================\n\n- Add support for Python 3.\n- Eliminate ZODB dependency. Instead of raising a\n ``ZODB.POSException.StorageError`` for unexpected ``TypeErrors``\n during commit, the new class\n ``nti.transactions.interfaces.CommitFailedError`` is raised.\n- Introduce a new subclass of ``TransactionError``,\n ``AbortFailedError`` that is raised when an abort fails due to a\n system error.\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/NextThought/nti.transactions", "keywords": "ZODB transaction", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "nti.transactions", "package_url": "https://pypi.org/project/nti.transactions/", "platform": "", "project_url": "https://pypi.org/project/nti.transactions/", "project_urls": { "Homepage": "https://github.com/NextThought/nti.transactions" }, "release_url": "https://pypi.org/project/nti.transactions/3.0.0/", "requires_dist": [ "setuptools", "dm.transaction.aborthook", "perfmetrics", "transaction (>=2.4.0)", "zope.exceptions", "zope.interface", "Sphinx (>=2.1.2) ; extra == 'docs'", "repoze.sphinx.autointerface ; extra == 'docs'", "pyhamcrest ; extra == 'docs'", "sphinx-rtd-theme ; extra == 'docs'", "gevent ; extra == 'gevent'", "zope.testrunner ; extra == 'test'", "nti.testing ; extra == 'test'", "fudge ; extra == 'test'" ], "requires_python": "", "summary": "NTI Transactions Utility", "version": "3.0.0" }, "last_serial": 5793083, "releases": { "0.0.0.dev0": [], "1.0.0": [ { "comment_text": "", "digests": { "md5": "4bafcda3e1b83fac9f026db7b9f0c0d4", "sha256": "6e7f7e3b8c36cfef033c93d38e58b295b6138683f57e3d67e97e3877425b82ea" }, "downloads": -1, "filename": "nti.transactions-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4bafcda3e1b83fac9f026db7b9f0c0d4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17907, "upload_time": "2016-07-28T17:09:59", "url": "https://files.pythonhosted.org/packages/8b/d3/1bb636db4de3dd6d0cfa2f7974aa4e03fa1b6e4735e5899491c706d56c70/nti.transactions-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a3ecf13febdb4e545680f284dfe8592", "sha256": "465533fb314326efc9c3d40a6bbc80a83bb430aa0e990ccfeec9ab1b29ac54d3" }, "downloads": -1, "filename": "nti.transactions-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9a3ecf13febdb4e545680f284dfe8592", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17259, "upload_time": "2016-07-28T17:10:02", "url": "https://files.pythonhosted.org/packages/43/95/8620c19ce6fafe07854412e7615422c8a53da49dfe4111635a8963fd9fa8/nti.transactions-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "edb48bcea00abac1aada89dba78b948f", "sha256": "fbc822fb521908738cc1738dd18cf15ebf29807b736405a4ebb0591441700b40" }, "downloads": -1, "filename": "nti.transactions-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "edb48bcea00abac1aada89dba78b948f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18928, "upload_time": "2017-04-17T16:56:54", "url": "https://files.pythonhosted.org/packages/e8/78/90b95a9ab42550e84d7450bb60e9a8d8877ab3ba66ae3048708ea8d9c4b4/nti.transactions-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ac56f8116c243a2d0bf60932944a24c", "sha256": "fa766e961dc72d7f25a554c745a8a8fc1fc1e89d9b5c6a7af792be5c39da4177" }, "downloads": -1, "filename": "nti.transactions-1.1.0.tar.gz", "has_sig": false, "md5_digest": "6ac56f8116c243a2d0bf60932944a24c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18217, "upload_time": "2017-04-17T16:56:56", "url": "https://files.pythonhosted.org/packages/c6/f8/341d8a9de1b8ea246d7f661c343d5a1b03905726255610dac5411feb58af/nti.transactions-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "9542e10c6285b5f0a9b34cf34523956e", "sha256": "e3b3a94bf02ec2783b9c428320c7d6b9841d678fef07b2e965dd8c0e3edb07f4" }, "downloads": -1, "filename": "nti.transactions-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9542e10c6285b5f0a9b34cf34523956e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16600, "upload_time": "2018-07-19T23:02:58", "url": "https://files.pythonhosted.org/packages/2c/56/82f17ca739b38690a15b350f6af65955a15ce8725ca3a4f1df1dbcdf308f/nti.transactions-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8b12cc4fa7874dab6804c22e6c55a2b", "sha256": "249f767d5d09ca4b58cd92d7c8d00cf6c1c0f26b18377ee2e8af5335ad381613" }, "downloads": -1, "filename": "nti.transactions-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b8b12cc4fa7874dab6804c22e6c55a2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17828, "upload_time": "2018-07-19T23:02:59", "url": "https://files.pythonhosted.org/packages/4d/1d/636298d30d39b7455cc120144dc3bc761df0025ae78de85dc27e2bdcc67e/nti.transactions-1.1.1.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "6229f891eb7ca649d70c3994df2c8628", "sha256": "76dd501a6d9991bdca6080fadbbe18c7d3f51d734d7da698685d53ac7b56e1b7" }, "downloads": -1, "filename": "nti.transactions-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6229f891eb7ca649d70c3994df2c8628", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17112, "upload_time": "2018-07-20T08:03:00", "url": "https://files.pythonhosted.org/packages/74/46/e80eda273978d0c388579138835c6bf3c4601b801b7a3f8b86693a088d42/nti.transactions-2.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5bbe726d418cba1e77bba35fff43682d", "sha256": "a8536eda78b56f85bc0b0f2ace0a87a1f3552851c408f8b8ef6c299e8f2c4000" }, "downloads": -1, "filename": "nti.transactions-2.0.0.tar.gz", "has_sig": false, "md5_digest": "5bbe726d418cba1e77bba35fff43682d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18505, "upload_time": "2018-07-20T08:03:01", "url": "https://files.pythonhosted.org/packages/1c/97/d75b5eaa8d3254b2ba1e3cae16a208764bd3ed2989c144d685c8090520f2/nti.transactions-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "aa667902bfeefede53ae11939489ec2c", "sha256": "12c75220f9f04f41125ac0a31305604f1f43c9d49ce7a3e8922575e5a5109148" }, "downloads": -1, "filename": "nti.transactions-2.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa667902bfeefede53ae11939489ec2c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17695, "upload_time": "2019-09-03T14:28:30", "url": "https://files.pythonhosted.org/packages/15/16/84164aa51d4a33700610f815850104617600777edaf4d1ea570855766bc2/nti.transactions-2.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "33e085aec4a04e1fe1a1903513e11acc", "sha256": "09a240361d41f975fa02828dc66ef971da440326084d7dacc338c1471bfe379e" }, "downloads": -1, "filename": "nti.transactions-2.0.1.tar.gz", "has_sig": false, "md5_digest": "33e085aec4a04e1fe1a1903513e11acc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18817, "upload_time": "2019-09-03T14:28:32", "url": "https://files.pythonhosted.org/packages/5b/5c/f4dd365ab540932a6b831cf827d84905f09079f48d2eac5dbd03613bcefb/nti.transactions-2.0.1.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "e5b676ab95513ea167c3b3bde15672ce", "sha256": "ab20d041db2bc5082bf45a8dc3c16aff522401385c8501cb32fc4ee2406d09c6" }, "downloads": -1, "filename": "nti.transactions-3.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e5b676ab95513ea167c3b3bde15672ce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20493, "upload_time": "2019-09-06T16:34:19", "url": "https://files.pythonhosted.org/packages/99/3c/aefef61604edf5cf0d2acfe99058c8b9ec0056b6a4f4a7d39831e31f186c/nti.transactions-3.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d1dc485166a9f8a5d0cf38e18fa3d3d", "sha256": "5574869452272d3000ac303c43d3f3b667498482ff4bb585ce9a84f904c8a55b" }, "downloads": -1, "filename": "nti.transactions-3.0.0.tar.gz", "has_sig": false, "md5_digest": "5d1dc485166a9f8a5d0cf38e18fa3d3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25905, "upload_time": "2019-09-06T16:34:20", "url": "https://files.pythonhosted.org/packages/98/76/75cca4262f4b0de151454a578ead26130b0a8957bf2a99a291f9d5a972b8/nti.transactions-3.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e5b676ab95513ea167c3b3bde15672ce", "sha256": "ab20d041db2bc5082bf45a8dc3c16aff522401385c8501cb32fc4ee2406d09c6" }, "downloads": -1, "filename": "nti.transactions-3.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e5b676ab95513ea167c3b3bde15672ce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20493, "upload_time": "2019-09-06T16:34:19", "url": "https://files.pythonhosted.org/packages/99/3c/aefef61604edf5cf0d2acfe99058c8b9ec0056b6a4f4a7d39831e31f186c/nti.transactions-3.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d1dc485166a9f8a5d0cf38e18fa3d3d", "sha256": "5574869452272d3000ac303c43d3f3b667498482ff4bb585ce9a84f904c8a55b" }, "downloads": -1, "filename": "nti.transactions-3.0.0.tar.gz", "has_sig": false, "md5_digest": "5d1dc485166a9f8a5d0cf38e18fa3d3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25905, "upload_time": "2019-09-06T16:34:20", "url": "https://files.pythonhosted.org/packages/98/76/75cca4262f4b0de151454a578ead26130b0a8957bf2a99a291f9d5a972b8/nti.transactions-3.0.0.tar.gz" } ] }