當前位置: 首頁>>代碼示例>>Python>>正文


Python current._scheduler方法代碼示例

本文整理匯總了Python中gluon.current._scheduler方法的典型用法代碼示例。如果您正苦於以下問題:Python current._scheduler方法的具體用法?Python current._scheduler怎麽用?Python current._scheduler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gluon.current的用法示例。


在下文中一共展示了current._scheduler方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from gluon import current [as 別名]
# 或者: from gluon.current import _scheduler [as 別名]
def __init__(self, db, tasks=None, migrate=True,
                 worker_name=None, group_names=None, heartbeat=HEARTBEAT,
                 max_empty_runs=0, discard_results=False, utc_time=False):

        MetaScheduler.__init__(self)

        self.db = db
        self.db_thread = None
        self.tasks = tasks
        self.group_names = group_names or ['main']
        self.heartbeat = heartbeat
        self.worker_name = worker_name or IDENTIFIER
        self.max_empty_runs = max_empty_runs
        self.discard_results = discard_results
        self.is_a_ticker = False
        self.do_assign_tasks = False
        self.greedy = False
        self.utc_time = utc_time
        self.w_stats = Storage(
            dict(
                status=RUNNING,
                sleep=heartbeat,
                total=0,
                errors=0,
                empty_runs=0,
                queue=0,
                distribution=None,
                workers=0)
        )  # dict holding statistics

        from gluon import current
        current._scheduler = self

        self.define_tables(db, migrate=migrate) 
開發者ID:HackPucBemobi,項目名稱:touch-pay-client,代碼行數:36,代碼來源:scheduler.py

示例2: __init__

# 需要導入模塊: from gluon import current [as 別名]
# 或者: from gluon.current import _scheduler [as 別名]
def __init__(self, db, tasks=None, migrate=True,
                 worker_name=None, group_names=None, heartbeat=HEARTBEAT,
                 max_empty_runs=0, discard_results=False, utc_time=False):

        MetaScheduler.__init__(self)

        self.db = db
        self.db_thread = None
        self.tasks = tasks
        self.group_names = group_names or ['main']
        self.heartbeat = heartbeat
        self.worker_name = worker_name or IDENTIFIER
        self.max_empty_runs = max_empty_runs
        self.discard_results = discard_results
        self.is_a_ticker = False
        self.do_assign_tasks = False
        self.greedy = False
        self.utc_time = utc_time
        self.w_stats = Storage(
            dict(
                status=RUNNING,
                sleep=heartbeat,
                total=0,
                errors=0,
                empty_runs=0,
                queue=0,
                distribution=None,
                workers=0)
        ) #dict holding statistics

        from gluon import current
        current._scheduler = self

        self.define_tables(db, migrate=migrate) 
開發者ID:StuffShare,項目名稱:StuffShare,代碼行數:36,代碼來源:scheduler.py


注:本文中的gluon.current._scheduler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。