{ "info": { "author": "Fatih K\u0131l\u0131\u00e7", "author_email": "m.fatihklc0@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "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", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# Django Serviceless Distributor\nThe Django Serviceless Distributor is a library to help you to run exact functions without any other servers.\n\n## How it works?\nIt is simply a decorator which takes arguments and keyword arguments, pickles them and sends them to other nodes with **HTTP** requests.\n\n## Is it efficient to use?\nThe answer is depends on the mode you select. If you set `Distributor.bounce_mode = False` one node need to send data to all nodes **BUT** if you set `Distributor.bounce_mode = True` (which is default) all nodes will send data to next node so all nodes will make only one request instead of `len(SERVICELESS_DISTRIBUTOR_NODES)`.\n\n## Is it secure?\nIt is secure as you keep your **SECRET_KEY** as a secret. Library uses `django.core.signing` to sign and unsign data to make sure data is sent over servers. **BUT** it is always recommended to configure your servers to restrict IPs connecting to this endpoint.\n\n## Quick Start\nInstall library\n```bash\npip install django-serviceless-distributor\n```\n\nConfigure your `urls.py`\n```py\n ....\n path(\"serviceless_distributor\", include(\"django_serviceless_distributor.urls\")),\n ....\n```\n\nConfigure your `settings.py`\n```py\n# Nodes IPs (Do not use load balancer IP, we couldn't know\n# if all nodes affected if you use load balancer IP)\nSERVICELESS_DISTRIBUTOR_NODES = [\"http://10.0.0.0\", \"http://10.0.0.1\", ....]\n\n# Headers to use while sending data\n# (This can be used to change \"Host\" to pass ALLOWED_HOSTS restriction)\nSERVICELESS_DISTRIBUTOR_HEADERS = {}\n```\n\nRegister functions you want to distributed\n```py\nfrom serviceless_distributor import Distributor\n\n@Distributor.register_function()\ndef sum_arguments(*args):\n return sum(args)\n\n# Or lets suppose you want to distribute an imported function\nfrom some_module import some_function\n\nsome_function = Distributor.register_function()(some_function)\n```\n\n\n### (Not) Frequently Asked Questions\n1. How do I set different node set for diffrent functions?\n ```py\n special_nodes = [\"http://10.0.0.0\", \"http://10.0.0.1\"]\n\n @Distributor.register_function(nodes=special_nodes)\n def sum_arguments(*args):\n return sum(args)\n\n # Or\n from some_module import some_function\n\n Distributor.register_function(nodes=special_nodes)(some_function)\n ```\n\n2. Can I change the path?\n\n Yes, you can change `Distributor.path` **BUT** also don't forget to change `urls.py` according to the change you made.\n\n3. How many requests sent by library simultaneously?\n\n It is 10 by default but you can change by setting `Distributor.simultaneous_requests`. **ATTENTION** by simultaneously requests it means distributing registered functions to other nodes. If you run a registered function X times in a row server will send X times of requests. It doesn't create X threads for every registered function run.\n\n4. Is it blocking?\n\n **No**, it creates threads using `concurrent.futures.ThreadPoolExecutor` and returns the output of registered function.\n\n5. Why should I use this instead of other libraries?\n\n The only reason could be saving money this is actually why I created that. To me this isn't a good solution when compared to other libraries but the best at least I can do without any other servers.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://pypi.org/project/django-serviceless-distributor/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/FKLC/django-serviceless-distributor", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-serviceless-distributor", "package_url": "https://pypi.org/project/django-serviceless-distributor/", "platform": "", "project_url": "https://pypi.org/project/django-serviceless-distributor/", "project_urls": { "Download": "https://pypi.org/project/django-serviceless-distributor/", "Homepage": "https://github.com/FKLC/django-serviceless-distributor" }, "release_url": "https://pypi.org/project/django-serviceless-distributor/1.0.4/", "requires_dist": [ "django", "serviceless-distributor" ], "requires_python": "", "summary": "A simple Django app to run exact functions over all server nodes without any service.", "version": "1.0.4" }, "last_serial": 5007919, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "0d98d702573bc75a9d97b0db9a6a6859", "sha256": "e07860c373546387e4655ae5b9ada7c0b02211c292dd1a991e748a1669d01de1" }, "downloads": -1, "filename": "django-serviceless-distributor-1.0.3.tar.gz", "has_sig": false, "md5_digest": "0d98d702573bc75a9d97b0db9a6a6859", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5503, "upload_time": "2019-03-10T12:54:21", "url": "https://files.pythonhosted.org/packages/c6/9a/38e8bf432bb23366b8c32ac8d65ff4cd8acf99a5dfc800eee3bef1eac202/django-serviceless-distributor-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "2dfd83cecd813d883fda78d7bff73e74", "sha256": "ffd95aae721a6029e84bcef1173ce5754a38e6d8f987e6712cff3b44539a2f48" }, "downloads": -1, "filename": "django_serviceless_distributor-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "2dfd83cecd813d883fda78d7bff73e74", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5372, "upload_time": "2019-03-30T20:54:28", "url": "https://files.pythonhosted.org/packages/07/23/deaf1017cf9fb57b20f31150580e494417f0bf38609434a5d4109f1b8b26/django_serviceless_distributor-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f169659a93313f5ef95123a0405ac03", "sha256": "0f31a28114c6506ae191c684cf3a3ea5ed7eeb699cf0b5c8e03ff339353e60af" }, "downloads": -1, "filename": "django-serviceless-distributor-1.0.4.tar.gz", "has_sig": false, "md5_digest": "2f169659a93313f5ef95123a0405ac03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4270, "upload_time": "2019-03-30T20:54:29", "url": "https://files.pythonhosted.org/packages/96/98/17613164bd09920e35271b6c095f6b0e27621250715bab22087c38010c49/django-serviceless-distributor-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2dfd83cecd813d883fda78d7bff73e74", "sha256": "ffd95aae721a6029e84bcef1173ce5754a38e6d8f987e6712cff3b44539a2f48" }, "downloads": -1, "filename": "django_serviceless_distributor-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "2dfd83cecd813d883fda78d7bff73e74", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5372, "upload_time": "2019-03-30T20:54:28", "url": "https://files.pythonhosted.org/packages/07/23/deaf1017cf9fb57b20f31150580e494417f0bf38609434a5d4109f1b8b26/django_serviceless_distributor-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f169659a93313f5ef95123a0405ac03", "sha256": "0f31a28114c6506ae191c684cf3a3ea5ed7eeb699cf0b5c8e03ff339353e60af" }, "downloads": -1, "filename": "django-serviceless-distributor-1.0.4.tar.gz", "has_sig": false, "md5_digest": "2f169659a93313f5ef95123a0405ac03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4270, "upload_time": "2019-03-30T20:54:29", "url": "https://files.pythonhosted.org/packages/96/98/17613164bd09920e35271b6c095f6b0e27621250715bab22087c38010c49/django-serviceless-distributor-1.0.4.tar.gz" } ] }