Brief Introduction
Scheduling management is Dnn provides a mechanism for developers to schedule tasks at certain intervals.
Similarly, it is implemented based on the provider mode, therefore, you can create or modify the original scheduling service without changing the core Code . View the relevant information
you will find that this is the great contribution of Dan Caron, a member of the dnn core team:
it was during this time that Dan Caron single-handedly made a significant impact on
the project. based on his experience with other enterprise portals, he proceeded to
Add integrated Exception Handling and event logging to the application. this added
stability and "auditability"; two major factors in most professional software products.
He also added a complex, multithreaded schedto to the application. the scheduler
was not just a simple hard-coded implementation like I had seen in other ASP. net
projects, but rather it was fully retriable via an administration user interface. this
powerful new feature cocould be used to run background housekeeping jobs as well as
long-running tasks. with this in place, the extensibility of the application improved yet
again.
The scheduling service isWebApplicationProgram, So no
It can avoid interruptions or disconnection, And the scheduling service is obviously suspended.
Services will not24The hour is running, but you can only set a certain interval to execute this
Scheduling Service, whileDnnThe scheduling task is executed according to the defined scheduling schedule and can only be
It is valid when the program runs normally. Of course, you can also set the frequency of task execution.
Make the scheduling task run automatically (this frequency attribute is minute/Hours/By day)
The API
Schedulingprovider ($ dnnroot/components/providers/scheduling directory)
YuDnnSimilar to other provider classes, this scheduling provider class is required for the implementation of the scheduler.
Required methods:
Declare the scheduling event Delegate at the same time:
Scheduler ($ dnnroot/components/providers/scheduling directory)
This isDnnThe basic category of the scheduling service. All programs that need to implement the scheduling service must inherit from
It. This class provides the methods required for its inherited class implementation.Dowork()
'''''''''''''''''''''''''''''''''''''''' '''''''''''
'This is the sub that kicks off the actual
'Work within the schedulerclient's subclass
'''''''''''''''''''''''''''''''''''''''' '''''''''''
Public Mustoverride SubDowork ()
At the same timeSchedulingproviderDelegate declared under ClassThe event Method of the scheduler program is as follows:
Public EventProcessstartedAsWorkstarted
Public EventProcessprogressingAsWorkprogressing
Public EventProcesscompletedAsWorkcompleted
Public EventProcesserroredAsWorkerrored
Public SubStarted ()
RaiseeventProcessstarted (Me)
End Sub
Public SubProgressing ()
RaiseeventProcessprogressing (Me)
End Sub
Public SubCompleted ()
RaiseeventProcesscompleted (Me)
End Sub
Public SubErrored (ByrefObjexceptionAsException)
RaiseeventProcesserrored (Me, Objexception)
End Sub
'It will not reliably complete
Application_start
End Enum
Public EnumSchedulesource
Not_set
Started_from_schedule_change
Started_from_event
Started_from_timer
Started_from_begin_request
End Enum
Public EnumSchedulestatus
Not_set
Waiting_for_open_thread
Running_event_schedule
Running_timer_schedule
Running_request_schedule
Waiting_for_request
Shutting_down
Stopped
End Enum
Public EnumSchedulermode
Disabled = 0
Timer_method = 1
Request_method = 2
End Enum
Some enumeration types of the scheduling service(Additional)
Public EnumEventname
'Do not add application_end
The next section describes how to customize the scheduling service that meets your requirements !!!