C# Class Westwind.MessageQueueing.Scheduler

A generic scheduling service that runs on a background thread and fires events in a given check frequency
Inheritance: IDisposable
Afficher le fichier Open project: RickStrahl/Westwind.QueueMessageManager

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
Run ( ) : void

Runs the actual processing loop by checking the mail box

Method Details

AddItem() public méthode

public AddItem ( SchedulerItem item ) : void
item SchedulerItem
Résultat void

AddItem() public méthode

public AddItem ( byte data, string type ) : void
data byte
type string
Résultat void

AddItem() public méthode

Adds an item to the queue.
public AddItem ( object item ) : void
item object
Résultat void

AddItem() public méthode

public AddItem ( string textData, string type ) : void
textData string
type string
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GetNextItem() public méthode

Returns the next queued item or null on failure.
public GetNextItem ( ) : object
Résultat object

OnError() protected méthode

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
Résultat void

OnExecuteScheduledEvent() protected méthode

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
Résultat void

PingServer() public méthode

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
Résultat void

Start() public méthode

Starts the background Thread processing
public Start ( ) : void
Résultat void

Start() public méthode

Starts the background thread processing
public Start ( int checkFrequency ) : void
checkFrequency int Frequency that checks are performed in seconds
Résultat void

Stop() public méthode

Causes the processing to stop. If the operation is still active it will stop after the current message processing completes
public Stop ( ) : void
Résultat void