Name | thread6 JSON |
Version |
0.2.0
JSON |
| download |
home_page | https://github.com/Haizzz/thread6 |
Summary | A plug n play multithreading interface |
upload_time | 2018-08-18 16:35:23 |
maintainer | |
docs_url | None |
author | Anh Le |
requires_python | |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# thread6
Simple parallel processing interface for python
## Why?
Python's built in parallel processing and threading library is pretty simple to implement but sometimes you just want to chuck data at a function and make it run faster
## Requirements
Python 3+
## Installation
## Quickstart
Use the `threaded` decorator to turn a method into a threaded method. That's it!
```python
@thread6.threaded()
def threaded_print():
print("")
return 1
```
Alternatively, use `run_threaded` function
```python
thread6.run_threaded(threaded_print)
```
Both the `threaded` decorator and `run_threaded` method will return an instance of
`ResultThread`. This allow you to optionally wait for the function to finish executing
and get the return value. To get the return value, use `.await_output()`
```python
result = threaded_print()
result.await_output() # this will return 1
```
If you have a function that needs to execute on a large list of data, use `run_chunked`
```python
def update_items(items):
...
items = [...]
thread6.run_chunked(update_items, items)
```
`.await_output()` also work with `run_chunked` but will return a list of return values instead
## Usage
## Todo
- [x] threaded function decorator
- [x] run something in a separate thread function
- [x] split data into chunk and run in separate threads
- [ ] add way for errors to fail loudly
- [ ] auto spawn to run fx on a set of data
- [ ] explore multi processing?
Raw data
{
"_id": null,
"home_page": "https://github.com/Haizzz/thread6",
"name": "thread6",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Anh Le",
"author_email": "hi@imanhle.com",
"download_url": "https://files.pythonhosted.org/packages/39/f2/cd7b53367c00a0e4a37c53c5b18007a50fb66f19331699c894c918230b8b/thread6-0.2.0.tar.gz",
"platform": "",
"description": "# thread6\nSimple parallel processing interface for python\n\n## Why?\nPython's built in parallel processing and threading library is pretty simple to implement but sometimes you just want to chuck data at a function and make it run faster\n\n## Requirements\nPython 3+\n\n## Installation\n\n## Quickstart\nUse the `threaded` decorator to turn a method into a threaded method. That's it!\n```python\n@thread6.threaded()\ndef threaded_print():\n print(\"\")\n return 1\n```\n\nAlternatively, use `run_threaded` function\n```python\nthread6.run_threaded(threaded_print)\n```\n\nBoth the `threaded` decorator and `run_threaded` method will return an instance of\n`ResultThread`. This allow you to optionally wait for the function to finish executing \nand get the return value. To get the return value, use `.await_output()`\n```python\nresult = threaded_print()\nresult.await_output() # this will return 1\n```\n\nIf you have a function that needs to execute on a large list of data, use `run_chunked`\n```python\ndef update_items(items):\n ...\n\nitems = [...]\nthread6.run_chunked(update_items, items)\n```\n`.await_output()` also work with `run_chunked` but will return a list of return values instead\n\n## Usage\n\n\n## Todo\n- [x] threaded function decorator\n- [x] run something in a separate thread function\n- [x] split data into chunk and run in separate threads\n- [ ] add way for errors to fail loudly\n- [ ] auto spawn to run fx on a set of data\n- [ ] explore multi processing?\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A plug n play multithreading interface",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/Haizzz/thread6"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f0463a1220d4f933c1a2b4eba2d0d9306cac0ba0d758a9c3958a4213edba6866",
"md5": "d63080b4d13e6ff0edfc91f3585df86d",
"sha256": "618037241f4a486940ca8e9c1f8cb0a476473c6036dc10a717c1ff5fbdabd7fc"
},
"downloads": -1,
"filename": "thread6-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d63080b4d13e6ff0edfc91f3585df86d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4199,
"upload_time": "2018-08-18T16:35:21",
"upload_time_iso_8601": "2018-08-18T16:35:21.946458Z",
"url": "https://files.pythonhosted.org/packages/f0/46/3a1220d4f933c1a2b4eba2d0d9306cac0ba0d758a9c3958a4213edba6866/thread6-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "39f2cd7b53367c00a0e4a37c53c5b18007a50fb66f19331699c894c918230b8b",
"md5": "7b3d9b27b3e686a992e607541c0fc8a8",
"sha256": "ed7a398e7f4d7fcedfcbc689ed3ef11179b040ead277ba15a6b316ff7d4d1b81"
},
"downloads": -1,
"filename": "thread6-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "7b3d9b27b3e686a992e607541c0fc8a8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3583,
"upload_time": "2018-08-18T16:35:23",
"upload_time_iso_8601": "2018-08-18T16:35:23.366990Z",
"url": "https://files.pythonhosted.org/packages/39/f2/cd7b53367c00a0e4a37c53c5b18007a50fb66f19331699c894c918230b8b/thread6-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2018-08-18 16:35:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Haizzz",
"github_project": "thread6",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "thread6"
}