Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Gevent Crontab Scheduler

Project description

# GeventCron

### 原理:

他的`缺点`就是,别让gevent调度堵塞了....尽量让你业务逻辑,采用gevent patch模块

正在尝试下,借助spawn_later周期功能,解决堵塞的问题, [查看更多GeventCron相关信息](

### 安装方法:
pip install geventcron


python install

### 使用方法:

import time
import requests
import threading
import functools
from datetime import datetime

import geventcron

def async(func):
def wrapper(*args, **kwargs):
my_thread = threading.Thread(target=func, args=args, kwargs=kwargs)
return wrapper

def func_1():
print 'Call func_1'

def func_2():
print 'Call func_2'

def func_3():
print 'Call func_3'

def block():

if __name__ == "__main__":
scheduler = geventcron.Scheduler(logger_name='task_scheduler')
scheduler.schedule('task_1', geventcron.Interval("*/1 * * * *"), func_1)
scheduler.schedule('task_2', geventcron.Interval(2), func_2)
scheduler.schedule('task_3', geventcron.Interval(3), func_3)
# scheduler.run_forever()
print "daemon"

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for geventcron, version 1.5
Filename, size File type Python version Upload date Hashes
Filename, size geventcron-1.5.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page