Class Scheduler

A generic scheduling service that runs on a background thread and fires events in a given check frequency.

System.Object
  Westwind.Utilities.Scheduler
public class Scheduler : object, IDisposable

Class Members

MemberDescription

Constructor

ExecuteScheduledEvent

Event that is fired when

AddItem

Adds an item to the queue.

public void AddItem(object item)

public void AddItem(SchedulerItem item)

public void AddItem(string textData,     string type)

public void AddItem(Byte[] data,     string type)

Dispose

public sealed void Dispose()

GetNextItem

Returns the next queued item or null on failure.

public object GetNextItem()

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 void PingServer(string url)

Start

Starts the background thread processing

public void Start(int checkFrequency)

public void Start()

Stop

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

public void Stop()

Cancelled

Determines the status the Scheduler

CheckFrequency

The frequency in how often the main method is executed. Given in milli-seconds.

Items

Memory based queue that contains items and allows retrieval of items.

Note memory based! This means if app crashses or is shut down messages might get lost.

If message persistence is important your scheduling store should be a database. You can use the QueueMessageManager object for example.

WebServerPingUrl

Optional URL that is pinged occasionally to ensure the server stays alive.

If empty hits root web page (~/yourapp/)

Requirements

Namespace: Westwind.Utilities
Assembly: westwind.utilities.dll

© West Wind Technologies, 2019 • Updated: 06/23/19
Comment or report problem with topic