C# Class RedisQueue.Net.ServiceProvider.Old.QueueMonitor

Exibir arquivo Open project: e-travel/RedisQueue.Net Class Usage Examples

Public Methods

Method Description
QueueMonitor ( ) : System

Ctor. Creates and consumes a new {RedisQueueClient} instance.

QueueMonitor ( QueueClient queue ) : System

Ctor. Requires a {RedisQueueClient} instance.

SignalNewTasksArrived ( ) : void

Lets the main process know that more tasks are available.

Start ( ) : void

The main work method, signalling the monitor to start observing the queue defined in configuration.

Stop ( ) : void

Protected Methods

Method Description
Run ( ) : void

The main monitor run method. What it does is try to reserve a task and dispatch it in a separate application domain. A couple of notes follow: AppDomain load / unload policy The current policy is pretty straightforward. As long as the monitor finds tasks in the queue, it will re-use the application domain. As soon as the queue is empty, it will attempt to unload the application domain. Stuck tasks ...will currently hang the service. Probable TODO: Monitor the AppDomain and kill / fail stuck tasks.

Private Methods

Method Description
initAppDomain ( ) : void
releaseAppDomain ( ) : bool
resolvePath ( string workerAssemblyPath ) : string

Method Details

QueueMonitor() public method

Ctor. Creates and consumes a new {RedisQueueClient} instance.
public QueueMonitor ( ) : System
return System

QueueMonitor() public method

Ctor. Requires a {RedisQueueClient} instance.
public QueueMonitor ( QueueClient queue ) : System
queue RedisQueue.Net.Clients.QueueClient
return System

Run() protected method

The main monitor run method. What it does is try to reserve a task and dispatch it in a separate application domain. A couple of notes follow: AppDomain load / unload policy The current policy is pretty straightforward. As long as the monitor finds tasks in the queue, it will re-use the application domain. As soon as the queue is empty, it will attempt to unload the application domain. Stuck tasks ...will currently hang the service. Probable TODO: Monitor the AppDomain and kill / fail stuck tasks.
protected Run ( ) : void
return void

SignalNewTasksArrived() public method

Lets the main process know that more tasks are available.
public SignalNewTasksArrived ( ) : void
return void

Start() public method

The main work method, signalling the monitor to start observing the queue defined in configuration.
public Start ( ) : void
return void

Stop() public method

public Stop ( ) : void
return void