Skip to main content

Scheduler

Simple scheduler module

Installation

Only tested on Python 3.X

From source:

$ python setup.py install

For production:

$ pip install job-scheduler

Usage

from datetime import datetime
from datetime import timedelta
from haydn.scheduler import S
from haydn.event_emitter import EventEmitter
import logging

logging.basicConfig(level=logging.DEBUG)


class Example(EventEmitter):

    def __init__(self):
        self.schedule_manager = Scheduler(timer_interval=1)

    def main(self):
        schedule_time = ScheduleTime(start_datetime=datetime.utcnow() + timedelta(seconds=2), end_datetime=datetime.utcnow() + timedelta(seconds=100), repeat=ScheduleTime.REPEAT_SECOND, repeat_interval=5, repeat_limit=5)
        schedule = Schedule(schedule_time, self.do_something, task_params=[1], reference_id=1)

        self.schedule_manager.add_schedule(schedule)
        self.schedule_manager.start()

    def do_something(self, p1):
        print("doing task")
        print("task parameter: ", p1)


example = Example()
example.main()

Release files for job-scheduler 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for job-scheduler 0.3.4
File Size Uploaded
job-scheduler-0.3.4.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for job-scheduler 0.3.4
File Interpreter ABI Platform
job_scheduler-0.3.4-py3.7.egg Legacy Egg format - - Details

Total release size: 11.7 kB

Release files / job-scheduler-0.3.4.tar.gz

Download URL job-scheduler-0.3.4.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1ec88367e787a28e310e047b8c785dceab1098914319206466b070444486c55f
BLAKE2b-256 checksum
How to use checksums
1ec7d4007dd2b4cc5f677d07cfd9291df95098a59980b71596d9e7fe14c2f130
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.2

Release files / job_scheduler-0.3.4-py3.7.egg

Download URL job_scheduler-0.3.4-py3.7.egg
Size 8.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
34e378128ce9f47230be552118cb0fec2de9b06d6b8ac2353c0792a9b5a0ea1f
BLAKE2b-256 checksum
How to use checksums
7f868bc7997a37145f1a71498c51ceaec90e4b14123dc14d698c45c1fbb7c47e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page