Skip to main content

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


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.7.tar.gz (24.4 kB view details)

Uploaded Source

File details

Details for the file distask-0.1.7.tar.gz.

File metadata

  • Download URL: distask-0.1.7.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

Hashes for distask-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4ffc1e9405421acb8b9a850eafdd9b9db6114c3b16b019ee6557c25f7aff38ff
MD5 09ce5bc639b32612af90af56698b3b12
BLAKE2b-256 07550ab72538e5f611857da888fa98acfe9b2bb49c5f8b91bfb098fdb3811af8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page