{ "info": { "author": "Marcel Hellkamp", "author_email": "marc@gsites.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3" ], "description": "Pycopine - Handle with Care\n===========================\n\nPycopine is a latency and fault tolerance library designed to isolate points of\naccess to remote systems, services and 3rd party libraries, stop cascading\nfailure and enable resilience in complex distributed systems where failure\nis inevitable.\n\nAs this copy-pasted text suggests, pycopine is heavily inspired by\n`Hystrix `_. \n\nPrerequisites\n-------------\n\nPycopine requires Python 3.2+, but may be backportet to 2.7 in the future.\n\nInstallation\n------------\n\nPycopine is not released yet.\n\n(Planned) Features\n------------------\n\n* Detect and report failing services.\n* Short-circuit services that fail on high load to help them recover.\n* Monitor failure rates and performance metrics to detect bottlenecks.\n* Manage thread pool and queue sizes on demand, at runtime, from everywhere.\n* ... (more to come)\n\nExample\n-------\n\nLets say we want to speak to a remote service that is slow, unreliable or both:\n\n.. code-block:: python\n\n import time\n import random\n \n def crappy_service(input):\n ''' The most useless piece of code ever.'''\n time.sleep(5)\n if 'OK' != random.choice(['OK', 'OK', 'f**ck']):\n raise RuntimeError('We broke something.')\n return input\n\nYou could throw lots of threads and try/except clauses at the problem and hope\nto not break the internet. Or you could use pycopine:\n\n.. code-block:: python\n\n from pycopine import Command\n \n class MyCommand(Command):\n ''' Does nothing with the input, but with style. '''\n \n def run(self, input):\n return crappy_service(input)\n\n def fallback(self, input):\n return input\n \n # Run and wait for the result\n result = MyCommand('input').result()\n \n # Give up after 2 seconds\n result = MyCommand('input').result(timeout=2)\n \n # Fire and forget\n MyCommand('input').submit()\n \n # Do stuff in parallel\n foo = MyCommand('input_a').submit()\n bar = MyCommand('input_b').submit()\n results = [foo.result(), bar.result()]\n \n # Change your mind midway through\n foobar = MyCommand('input').submit()\n if foobar.wait(timeout=2):\n result = foobar.reault()\n else:\n foobar.cancel(RuntimeError('No time for this sh**t'))\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/pycopine/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/defnull/pycopine", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pycopine", "package_url": "https://pypi.org/project/pycopine/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pycopine/", "project_urls": { "Download": "http://pypi.python.org/pypi/pycopine/", "Homepage": "https://github.com/defnull/pycopine" }, "release_url": "https://pypi.org/project/pycopine/0.1.dev1/", "requires_dist": null, "requires_python": null, "summary": "Latency and fault tolerance library inspired by Hystrix.", "version": "0.1.dev1" }, "last_serial": 663290, "releases": { "0.1.dev1": [ { "comment_text": "", "digests": { "md5": "be5f55087eba33fc51164b6b3e41c3c7", "sha256": "622d9648f9a53ad278b68bf37006bddee404b81fde1df280ba2ce4f1f01d0de2" }, "downloads": -1, "filename": "pycopine-0.1.dev1.tar.gz", "has_sig": false, "md5_digest": "be5f55087eba33fc51164b6b3e41c3c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8098, "upload_time": "2013-05-16T20:57:42", "url": "https://files.pythonhosted.org/packages/72/7e/b55d00dc206c446c6559e6da14a37e179f015086445430ad536110ee156f/pycopine-0.1.dev1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "be5f55087eba33fc51164b6b3e41c3c7", "sha256": "622d9648f9a53ad278b68bf37006bddee404b81fde1df280ba2ce4f1f01d0de2" }, "downloads": -1, "filename": "pycopine-0.1.dev1.tar.gz", "has_sig": false, "md5_digest": "be5f55087eba33fc51164b6b3e41c3c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8098, "upload_time": "2013-05-16T20:57:42", "url": "https://files.pythonhosted.org/packages/72/7e/b55d00dc206c446c6559e6da14a37e179f015086445430ad536110ee156f/pycopine-0.1.dev1.tar.gz" } ] }