{ "info": { "author": "Cottonwood Technology", "author_email": "info@cottonwood.tech", "bugtrack_url": null, "classifiers": [ "Framework :: AsyncIO", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython" ], "description": "\nAIOConductor\n============\n\nIt is a small library,\nwhich solves single task:\norchestration of asynchronous applications.\n\nFor example,\nwe have an application,\nwhich consists of database,\nmessage queue,\nweb API,\nand background workers.\nDatabase and message queue are independent,\nthey can be launched concurrently.\nWeb API and background workers are independent too.\nBut they both depend on database and message queue.\nSo they should be launched after and stopped before database and message queue.\n\nThis is how it can be solved using AIOConductor.\n\n.. code-block:: python\n\n from aioconductor import Conductor, Component\n\n class Database(Component):\n\n async def setup(self):\n \"\"\" Setup database \"\"\"\n\n async def shutdown(self):\n \"\"\" Shutdown database \"\"\"\n\n class MessageQueue(Component):\n\n async def setup(self):\n \"\"\" Setup message queue \"\"\"\n\n async def shutdown(self):\n \"\"\" Shutdown message queue \"\"\"\n\n class WebAPI(Component):\n\n db: Database # Dependencies are declared by type annotations.\n queue: MessageQueue # Real instances of the components will be injected\n # during setup routine.\n\n async def setup(self):\n \"\"\" Setup web API \"\"\"\n\n async def shutdown(self):\n \"\"\" Shutdown web API \"\"\"\n\n class BackgroundWorkers(Component):\n\n db: Database\n queue: MessageQueue\n\n async def setup(self):\n \"\"\" Setup background workers \"\"\"\n\n async def shutdown(self):\n \"\"\" Shutdown background workers \"\"\"\n\n conductor = Conductor(config={})\n conductor.add(WebAPI)\n conductor.add(BackgroundWorkers)\n conductor.serve()\n\nThe code above will run concurrent setup of ``Database`` and ``MessageQueue``,\nand then concurrent setup of ``WebAPI`` and ``BackgroundWorkers``.\nShutdown will be run in opposite order.\n\nConductor also provides ability to patch component by alternative implementation.\nIt can be useful for testing.\n\n.. code-block:: python\n\n class MessageQueueMock(Component):\n async def setup(self):\n \"\"\" Setup message queue mock \"\"\"\n\n async def shutdown(self):\n \"\"\" Shutdown message queue mock \"\"\"\n\n conductor = Conductor(config={})\n\n conductor.patch(MessageQueue, MessageQueueMock)\n # An instance of ``MessageQueueMock`` will be injected into\n # ``WebAPI`` and ``BackgroundWorkers``, instead of ``MessageQueue``.\n\n conductor.add(WebAPI)\n conductor.add(BackgroundWorkers)\n conductor.serve()\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/cottonwood-tech/aioconductor/", "keywords": "asyncio asynchronous orchestration orchestrator conductor injector service component", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "AIOConductor", "package_url": "https://pypi.org/project/AIOConductor/", "platform": "", "project_url": "https://pypi.org/project/AIOConductor/", "project_urls": { "Homepage": "https://bitbucket.org/cottonwood-tech/aioconductor/" }, "release_url": "https://pypi.org/project/AIOConductor/0.1/", "requires_dist": null, "requires_python": "", "summary": "asynchronous application orchestrator", "version": "0.1" }, "last_serial": 4556386, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "319c22d0f0aaba5e66b5c047aec1065f", "sha256": "103bc83fa79d6b84e237dbb40044ed3e99412d1b553eba118314a6b56af795c4" }, "downloads": -1, "filename": "AIOConductor-0.1-py36-none-any.whl", "has_sig": false, "md5_digest": "319c22d0f0aaba5e66b5c047aec1065f", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": null, "size": 6116, "upload_time": "2018-12-03T16:26:18", "url": "https://files.pythonhosted.org/packages/8c/ce/2753e3e2b08984852b502224c78a05f6a60b2a9b2c50da6c1b5911af02cc/AIOConductor-0.1-py36-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "319c22d0f0aaba5e66b5c047aec1065f", "sha256": "103bc83fa79d6b84e237dbb40044ed3e99412d1b553eba118314a6b56af795c4" }, "downloads": -1, "filename": "AIOConductor-0.1-py36-none-any.whl", "has_sig": false, "md5_digest": "319c22d0f0aaba5e66b5c047aec1065f", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": null, "size": 6116, "upload_time": "2018-12-03T16:26:18", "url": "https://files.pythonhosted.org/packages/8c/ce/2753e3e2b08984852b502224c78a05f6a60b2a9b2c50da6c1b5911af02cc/AIOConductor-0.1-py36-none-any.whl" } ] }