{ "info": { "author": "Dillon Bowen", "author_email": "dsbowen@wharton.upenn.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Flask-Worker\n\nFlask-Worker simplifies interaction with a Redis Queue for executing long-running tasks in a Flask application. \n\nLong-running tasks are managed by a Worker, who sends the client a loading page until it completes the task. Upon completing the task, the Worker automatically replaces the client's window with the loaded page.\n\n## Example\n\nSuppose a model (the employer) must run a long, complex task before the next page loads.\n\nWhat we want is for the complex task to run once, and for the view function to return a loading page while the complex task is running. Additional requests to this route should not cause the complex task to run multiple times. Once the task is complete, the loaded page should appear automatically. \n\nAfter setup, we can achieve this with the following:\n\n```python\n@app.route('/')\ndef index():\n employer = Employer.query.filter_by(name='name').first()\n if employer.worker is None:\n employer.worker = Worker(method_name='complex_task')\n worker = employer.worker\n if not worker.job_finished:\n return worker()\n return 'Hello World'\n```\n\n## Documentation\n\nYou can find the latest documentation at [https://dsbowen.github.io/flask-worker](https://dsbowen.github.io/flask-worker).\n\n## License\n\nPublications which use this software should include the following citations for Flask-Worker and its dependency, [SQLAlchemy-Mutable](https://pypi.org/project/sqlalchemy-mutable/).\n\nBowen, D.S. (2019). Flask-Worker [Compluter software]. [https://github.com/dsbowen/flask-worker](https://github.com/dsbowen/flask-worker)\n\nBowen, D.S. (2019). SQLAlchemy-Mutable [Computer software]. [https://github.com/dsbowen/sqlalchemy-mutable](https://github.com/dsbowen/sqlalchemy-mutable)\n\nThis project is licensed under the MIT License [LICENSE](https://github.com/dsbowen/flask-worker/blob/master/LICENSE).\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dsbowen/flask-worker", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "flask-worker", "package_url": "https://pypi.org/project/flask-worker/", "platform": "", "project_url": "https://pypi.org/project/flask-worker/", "project_urls": { "Homepage": "https://github.com/dsbowen/flask-worker" }, "release_url": "https://pypi.org/project/flask-worker/0.0.2/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Flask-Worker simplifies interaction with a Redis Queue for executing long-running tasks in a Flask application.", "version": "0.0.2" }, "last_serial": 5990519, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6751402f882816274908ec28e9199f11", "sha256": "f42bbc372cb1209cd29a9f46a19b5393554ace06d48f7ef06fe358599b42325d" }, "downloads": -1, "filename": "flask_worker-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6751402f882816274908ec28e9199f11", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8574, "upload_time": "2019-10-14T22:14:19", "url": "https://files.pythonhosted.org/packages/77/9f/6238b9e8e7c1e904dfd173942c987a7aa86cd2f367cae92457557a7350e4/flask_worker-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "efef9de16bbed5ccbca0cdadee5d5782", "sha256": "f2666ecd89064059e53675728977660a65f75f024d451de48d6454c85b599090" }, "downloads": -1, "filename": "flask-worker-0.0.1.tar.gz", "has_sig": false, "md5_digest": "efef9de16bbed5ccbca0cdadee5d5782", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5884, "upload_time": "2019-10-14T22:14:22", "url": "https://files.pythonhosted.org/packages/a5/46/e136b9ec91fd74e855e5c46627dcae7bb931fd31a3d9eebc4b5bd37df9e8/flask-worker-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "a0d85fffb716c670a85ceec91128272f", "sha256": "f8d6923df68b83052da0eac4f25dc2941917f524ef13b2d20062e7115eaae5ba" }, "downloads": -1, "filename": "flask_worker-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a0d85fffb716c670a85ceec91128272f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10203, "upload_time": "2019-10-17T15:25:04", "url": "https://files.pythonhosted.org/packages/61/3d/c6045e439ae218b38823f13ae04ee64b16eb1f6f5c76ad49a7d208503852/flask_worker-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74807a41f1420ac2d9fd30f21788a46f", "sha256": "b9d6ba01816565049eed88dae5fda814c1489380b3be78436ba0fc0759c3421e" }, "downloads": -1, "filename": "flask-worker-0.0.2.tar.gz", "has_sig": false, "md5_digest": "74807a41f1420ac2d9fd30f21788a46f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6054, "upload_time": "2019-10-17T15:25:09", "url": "https://files.pythonhosted.org/packages/70/43/5c60c269298fab5de5eab587478b4145ac3d8381259369dd444729b1677f/flask-worker-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a0d85fffb716c670a85ceec91128272f", "sha256": "f8d6923df68b83052da0eac4f25dc2941917f524ef13b2d20062e7115eaae5ba" }, "downloads": -1, "filename": "flask_worker-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a0d85fffb716c670a85ceec91128272f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10203, "upload_time": "2019-10-17T15:25:04", "url": "https://files.pythonhosted.org/packages/61/3d/c6045e439ae218b38823f13ae04ee64b16eb1f6f5c76ad49a7d208503852/flask_worker-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74807a41f1420ac2d9fd30f21788a46f", "sha256": "b9d6ba01816565049eed88dae5fda814c1489380b3be78436ba0fc0759c3421e" }, "downloads": -1, "filename": "flask-worker-0.0.2.tar.gz", "has_sig": false, "md5_digest": "74807a41f1420ac2d9fd30f21788a46f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6054, "upload_time": "2019-10-17T15:25:09", "url": "https://files.pythonhosted.org/packages/70/43/5c60c269298fab5de5eab587478b4145ac3d8381259369dd444729b1677f/flask-worker-0.0.2.tar.gz" } ] }