Skip to main content

CronTab callback for Tornado

Project description

tornado-crontab is a library that can make the task apps like crontab.

Travis CI AppVeyor Code Climate Requirements Status

Installation

Automatic installation:

$ pip install tornado-crontab

torando-crontab is listed in PyPI and can be installed with pip or easy_install.

Manual installation:

$ git clone https://github.com/gaujin/tornado-crontab.git
$ cd tornado-crontab
$ python setup.py install

tornado-crontab source code is hosted on GitHub

Usage

Here is an example every minute task app:

from __future__ import print_function
import functools
import tornado.ioloop
import tornado_crontab

def hello_crontab(value):

    print("Hello, {0}".format(value))

if __name__ == "__main__":

    _func = functools.partial(hello_crontab, *["crontab"])
    tornado_crontab.CronTabCallback(_func, "* * * * *").start()
    tornado.ioloop.IOLoop.current().start()

decorator style task app:

from __future__ import print_function
import tornado.ioloop
from tornado_crontab import crontab

@crontab("* * * * *")
def hello_crontab(value):

    print("Hello, {0}".format(value))

if __name__ == "__main__":

    hello_crontab("crontab")
    tornado.ioloop.IOLoop.current().start()

Prerequisites

tornado-crontab 0.4.x or earlier runs on Tornado 4.x or earlier.

Future policy of io_loop argument

io_loop argument to function and constructor is deprecated for 0.4.0 and removed for 0.5.0.
About this policy is based on the policy already indicated in Tornado, tornado-crontab also made the same policy.

Using

License

See the LICENSE file for specific terms.

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

tornado-crontab-0.4.0.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file tornado-crontab-0.4.0.tar.gz.

File metadata

  • Download URL: tornado-crontab-0.4.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for tornado-crontab-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ca9e5c4c67429c0715306cfb7d083c0598f2ad85a04c44b3e68919fee1bd6b1e
MD5 89b336cf343f914973e7b90a29297b42
BLAKE2b-256 e021090cf0904635cef3078585994ddd9410e12c6d8bcfb77f7f787a848ef78c

See more details on using hashes here.

Supported by

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