a distribute task scheduler
Project description
a distribute task scheduler
example
from distask import create_scheduler, task, register_job
client_data = {
"t": "mongo",
"args": ["mongodb://admin:123456@127.0.0.1:27017"]
}
lock_data = {
"t": "rllock",
"reentrant":True,
"connection_details":connection_details,
"ttl":10_000
}
scheduler = create_scheduler(client_data, lock_data, serialize="json", groups=['test'], limit=1, maxwait=5)
@register_job(scheduler, "interval", args=(12, 123), group="test", subgroup="ssss", seconds=3)
def test1(times, aa=None, bb=None, *args):
print("test---------------------", util.time_now())
because pickle not support lamba function, if you choose serialize type 'pickle' please install 'dill'
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
distask-0.1.4.tar.gz
(24.4 kB
view details)
File details
Details for the file distask-0.1.4.tar.gz.
File metadata
- Download URL: distask-0.1.4.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ad1a5f74914ec1eac68eb8110d59e06b463a7d5938afdc46627d4dc0ae37813
|
|
| MD5 |
f8b9ee6e4204fddb2758ba642eed1582
|
|
| BLAKE2b-256 |
e70d5d96bd6da30d72a9dc846ba47a5c1227a3c9624e4e0c4e573fd7c83417f4
|