C# Класс Westwind.MessageQueueing.Scheduler

A generic scheduling service that runs on a background thread and fires events in a given check frequency
Наследование: IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
AddItem ( SchedulerItem item ) : void
AddItem ( byte data, string type ) : void
AddItem ( object item ) : void

Adds an item to the queue.

AddItem ( string textData, string type ) : void
Dispose ( ) : void
GetNextItem ( ) : object

Returns the next queued item or null on failure.

PingServer ( ) : void

Optional routine that pings a Url on the server to keep the server alive. Use this to avoid IIS shutting down your AppPools

Start ( ) : void

Starts the background Thread processing

Start ( int checkFrequency ) : void

Starts the background thread processing

Stop ( ) : void

Causes the processing to stop. If the operation is still active it will stop after the current message processing completes

Защищенные методы

Метод Описание
OnError ( Exception ex ) : void

This method is called if an error occurs during processing of the request. Override this method in your own implementation to provide for error logging or other handling of an error that occurred in processing. Ideally this shouldn't be necessary - your OnexecuteScheduledEvent code should handle any errors internally and provide for its own logging mechanism but this is here as an additional point of control.

OnExecuteScheduledEvent ( ) : void

Handles a scheduled operation. Checks to see if an event handler is set up and if so calls it. This method can also be overrriden in a subclass to implemnent custom functionality.

Приватные методы

Метод Описание
Run ( ) : void

Runs the actual processing loop by checking the mail box

Описание методов

AddItem() публичный Метод

public AddItem ( SchedulerItem item ) : void
item SchedulerItem
Результат void

AddItem() публичный Метод

public AddItem ( byte data, string type ) : void
data byte
type string
Результат void

AddItem() публичный Метод

Adds an item to the queue.
public AddItem ( object item ) : void
item object
Результат void

AddItem() публичный Метод

public AddItem ( string textData, string type ) : void
textData string
type string
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetNextItem() публичный Метод

Returns the next queued item or null on failure.
public GetNextItem ( ) : object
Результат object

OnError() защищенный Метод

This method is called if an error occurs during processing of the request. Override this method in your own implementation to provide for error logging or other handling of an error that occurred in processing. Ideally this shouldn't be necessary - your OnexecuteScheduledEvent code should handle any errors internally and provide for its own logging mechanism but this is here as an additional point of control.
protected OnError ( Exception ex ) : void
ex System.Exception Exception occurred during item execution
Результат void

OnExecuteScheduledEvent() защищенный Метод

Handles a scheduled operation. Checks to see if an event handler is set up and if so calls it. This method can also be overrriden in a subclass to implemnent custom functionality.
protected OnExecuteScheduledEvent ( ) : void
Результат void

PingServer() публичный Метод

Optional routine that pings a Url on the server to keep the server alive. Use this to avoid IIS shutting down your AppPools
public PingServer ( ) : void
Результат void

Start() публичный Метод

Starts the background Thread processing
public Start ( ) : void
Результат void

Start() публичный Метод

Starts the background thread processing
public Start ( int checkFrequency ) : void
checkFrequency int Frequency that checks are performed in seconds
Результат void

Stop() публичный Метод

Causes the processing to stop. If the operation is still active it will stop after the current message processing completes
public Stop ( ) : void
Результат void