. Net job scheduling platform,. net Job Scheduling

Source: Internet
Author: User

. Net job scheduling platform,. net Job Scheduling

Open Source Address: http://git.oschina.net/chejiangyi/Dyd.BaseService.TaskManager

. Net job scheduling Platform

It is used to mount. net dll and exe tasks, isolate tasks, schedule execution, access control, monitoring, management, logs, error warning, and performance analysis.

1) the platform develops the task scheduling function based on quartz.net and uses C # code. It supports corn expressions and third-party custom corn expressions.

2) The architecture is developed in the form of plug-ins, with good functional scalability, stability, and simplicity, so that third-party developers can further expand functions.

3) multi-node clusters are supported to facilitate the effective allocation of Cluster Server resources and separate tasks.

4) supports email-based error warnings to facilitate O & M and timely handling of task exceptions.


Open source group:. net open source basic service 238543768

Task demo

Using System; using System. collections. generic; using System. diagnostics; using System. linq; using System. text; using System. threading. tasks; namespace Dyd. baseService. taskManager. demo {/// <summary> /// demo and description of the task plug-in the task scheduling platform /// </summary> public class DemoTask: XXF. baseService. taskManager. baseDllTask {// <summary> // The Task Scheduling platform is configured based on the release time, scheduled callback running method // the developer's task plug-in must be reloaded and the method // </summary> public override Void Run () {/** this. openOperator is used by the task scheduling platform to encapsulate all the api interfaces provided to third parties * // * obtain the dll installation directory of the current task */this. openOperator. getTaskInstallDirectory ();/* print a log to the task scheduling platform. Because the log will be stored in the platform database, the log must be streamlined and there is analytical value for task errors. [Note: do not print useless or unnecessary logs that have no value for analysis. */this. openOperator. log ("print a Log here to the task scheduling platform");/* print an error to the task scheduling platform, because the Log will be stored in the platform database, so the Log needs to be streamlined, there is an analytical value for task errors. [Note: Do not print useless or unnecessary logs without value.] * priorities will be added for subsequent tasks based on task priorities, error frequency. The error log is periodically pushed to the developer's email address and SMS */this. opentracing Ator. error ("print an Error log to the task scheduling platform", new Exception ("Error msg information");/* Get the temporary data of the task from the database, temporary data is stored in the database as jason, facilitating task context recovery and information transmission [Note: it should not be used to "frequently" Store "a large amount of" temporary data, network Operation Time and database performance are poor] */var databasetempinfo = this. openOperator. getDataBaseTempData <DemoTaskDatabaseTempInfo> (); if (databasetempinfo = null) // if the task runs for the first time, there may be no temporary data. You can also configure temporary data when releasing a task. {Databasetempinfo = new DemoTaskDatabaseTempInfo (); databasetempinfo. lastLogID = 0;}/* persists the temporary data of the task to the database. The temporary data is saved in the database in json format to facilitate task context recovery and information transmission. [Note: this method should not be used to "frequently" Store "a large amount of" temporary data, which may affect network operation time and database performance.] If the temporary data is used for the next use, you must execute this method, otherwise, you cannot obtain it next time. [Note: if this method is executed, the current temporary data may be reset to null to facilitate memory resource release.] */this. openOperator. saveDataBaseTempData (databasetempinfo);/* obtain the temporary data of the task from the local installation directory. The temporary data is saved locally as jason, facilitating task context recovery and information transmission. [Note: local temporary data is generally used to save "a large amount of" temporary data "*/var lo Caltempinfo = this. OpenOperator. GetLocalTempData <DemoTaskLocalTempInfo> (); if (localtempinfo = null) // if the task runs for the first time, there may be no temporary data. Of course, you can also upload the temporary data json to the installation package when releasing the task. {Localtempinfo = new DemoTaskLocalTempInfo (); localtempinfo. file = new byte [0];}/* persists the temporary data of the task to the local installation directory. The temporary data is saved in the local installation directory in json format, this method facilitates task context recovery and information transmission. [Note: local temporary data is generally used to save "a large amount of" temporary data.] If temporary data is used for the next use, you must execute this method, otherwise, you may not be able to obtain it next time. [Note: When this method is executed, the current temporary data may be reset to null to facilitate memory resource release] */this. openOperator. saveLocalTempData (localtempinfo); {string msg = "executing business .... "+ this. appConfig ["sendmailhost"]; Debug. writeLine (msg); System. IO. file. appendAl LText (this. openOperator. getTaskInstallDirectory () + "service .txt", msg );}} /// <summary> /// developer's self-testing portal // you need to configure the project as-> console application, write the Program class and Main entry function // </summary> public override void TestRun () {/* the configuration information of the task in the test environment must be filled in manually, in the formal environment, you need to configure it in the task configuration center */this. appConfig = new XXF. baseService. taskManager. systemRuntime. taskAppConfigInfo (); this. appConfig. add ("sendmailhost", "smtp.163.com"); this. appConfig. add ("sendmailname", "Fengyeguigui@163.com"); this. appConfig. add ("password", "*******"); base. testRun () ;}//< summary> // temporary data information of the task scheduling platform, used to transmit the information of the task context. /// It will be stored in the database of the task scheduling platform in json format, so that it can be restored and used during the next Callback operation. [Note: it should not be used to "frequently" Store "a large amount of" temporary data, network Operation Time and database performance are poor. /// </summary> public class DemoTaskDatabaseTempInfo {public int LastLogID {get; set ;}} /// <summary> /// temporary data information of the task scheduling platform, which is used to transmit information about the task context. /// It will be stored in the local installation folder of the task scheduling platform in json format, so that it can be restored and used during the next Callback operation. [Note: local temporary data is generally used to save "a large amount of" temporary data "/// </summary> public class DemoTaskLocalTempInfo {public byte [] file {get; set ;}}}

 

   
Web backend and Installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.