Skip to main content

CronTab callback for Tornado

Project description

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

travis 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, {}".format(value))

if __name__ == "__main__":

    _func = functools.partial(hello_crontab, *["crontab"])
    tornado_crontab.CronTabCallback(_func, "* * * * *").start()
    tornado.ioloop.IOLoop.instance().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, {}".format(value))

if __name__ == "__main__":

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

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

Uploaded Source

File details

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

File metadata

  • Download URL: tornado-crontab-0.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tornado-crontab-0.2.tar.gz
Algorithm Hash digest
SHA256 774a8af698446392f54a4135e46962abae35491d7796fa9f407edd1bd832ad58
MD5 e986b8a6c968585475204442562ebe25
BLAKE2b-256 b2dcd4a63e5c8c121777fd6d1396e147c157982ff4241121c9b9c6b2e97a6182

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