A high-performance, asynchronous, ready for production task scheduling framework written in Python.
Project description
TaskShed 🛖
TaskShed is a high-performance, asynchronous, ready-for-production job scheduling framework.
The key features are:
- Fast: TaskShed has an extremely low latency, overhead and can execute several thousands jobs a second.
- Distributed: TaskShed has the capacity to spawn several workers and schedules across many machines, while also providing support for monolinth architectures.
- Persistant: Jobs are stored in database, meaning that jobs won't get dropped on shutdown. TaskShed currently supports Redis and MySQL.
- Easy: TaskShed is straightforward to run.
Installation 🔧
Install the core package using pip:
pip install taskshed
To use persistent datastores like Redis or MySQL, you need to install the optional dependencies:
pip install "taskshed[redis]"
pip install "taskshed[mysql]"
Quick Start 🏁
Here's a simple example of scheduling a job to run in 5 seconds.
from datetime import datetime, timedelta
from taskshed.datastores import InMemoryDataStore
from taskshed.schedulers import AsyncScheduler
from taskshed.workers import EventDrivenWorker
async def say_hello(name: str):
print(f"Hello, {name}!")
datastore = InMemoryDataStore()
worker = EventDrivenWorker(callback_map={"say_hello": say_hello}, datastore=datastore)
scheduler = AsyncScheduler(datastore=datastore, worker=worker)
async def main():
await scheduler.start()
await worker.start()
await scheduler.add_task(
callback="say_hello",
run_at=datetime.now() + timedelta(seconds=3),
kwargs={"name": "World"},
)
if __name__ == "__main__":
import asyncio
loop = asyncio.new_event_loop()
loop.create_task(main())
loop.run_forever()
Documentation 📚
Coming soon! 🚧
Contributing 🤝
Contributions are welcome! Please feel free to submit a pull request or open an issue.
License 📜
This project is licensed under the MIT 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file taskshed-0.6.0.tar.gz.
File metadata
- Download URL: taskshed-0.6.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c95236944733cb4fa96b1df5c5b77088eb62047c39f2692dc46f902093bad368
|
|
| MD5 |
513d0dbea41558287aec25fb1bc03ce6
|
|
| BLAKE2b-256 |
9208bfa16a90241ae482993db3322358a5e4a5e6a4f22404e5e714c7e7e6dc7b
|
File details
Details for the file taskshed-0.6.0-py3-none-any.whl.
File metadata
- Download URL: taskshed-0.6.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8663609c884f3860f09407822a1d9d88f27809b864b4ca75ed98c1ddbc63a085
|
|
| MD5 |
cc2a2311579d261ad149a13af595c6b0
|
|
| BLAKE2b-256 |
b9401ec0eec9f96e724d3071c2e6d370f127744ba74fa6e8464ee5efd08b45fe
|