#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2023/4/11 19:10 # @Author : old tom # @File : task_executor.py # @Project : futool-tiny-datahub # @Desc : 任务执行器,负责将任务添加到scheduler队列中 from common.futool.fu_function import singleton @singleton class CommonTaskExecutor(object): """ 通用任务执行器 """ def __init__(self, scheduler, cron_trigger): """ :param scheduler: 调度器 :param cron_trigger: cron触发器 """ self.cron_trigger = cron_trigger self.scheduler = scheduler def submit(self, source_id, cron): """ 提交任务 :param source_id: 数据源ID :param cron: cron表达式 :return: """ pass