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

Uploaded Source

File details

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

File metadata

  • Download URL: distask-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 08436382a57d0591b9a6edf930eaef6a8bdaeb3bde01304fb64d8f605847315e
MD5 59727a4774e8654fb94396aecf442855
BLAKE2b-256 940f82970c14df6c4a69342563dcf3f223df20f5f10c76c5977cd00a25bb029b

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