An asynchronous Tasks Library using asyncio
Project description
Pytask IO
Asynchronous Tasks Library using asyncio
An Asyncio based task queue that is designed to be super easy the use!
Install
pip install pytask-io
docker run redis # Rabbit MQ coming soon...
Usage
# Starts the task runner
pytask = PytaskIO(
store_port=8080,
store_host="localhost",
db=0,
workers=1,
)
# Start the PytaskIO task queue on a separate thread.
pytask.run()
# Handle a long running process, in this case a send email function
metadata = pytask.add_task(send_email, title, body)
# Try once to get the results of your email sometime in the future
result = get_task(metadata)
# Later we can use the `metadata` result to pass to `add_task`
result = poll_for_task(metadata, tries=100, interval=60)
# Stop PytaskIO completly (This will not effect any units of work that havent yet executed)
pytask.stop()
Authors
- joegasewicz - Initial work - @joegasewicz
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytask-io-0.0.2.tar.gz
(8.3 kB
view hashes)