C# Класс BlueCollar.Worker

Represents an individual worker that dequeues jobs and performs work.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CancelCurrent void
CreateHistory HistoryRecord
CreateQueueRetry QueueRecord
CreateWorking WorkingRecord
DequeueRecord WorkingRecord
Dispose void
ExecuteJob bool
KillRunThread void
KillSignalThread void
PruneOrphans void
RunLoop void
SetStatus void
SetStatus void
SignalLoop void
Start bool

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

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

Disposes of resources used by this instance.

Stop ( bool force ) : void

Stops the worker.

Worker ( string applicationName, long id, string name, QueueNameFilters queueFilters, int heartbeat, bool schedulerEnabled, IRepositoryFactory repositoryFactory, ILogger logger ) : System

Initializes a new instance of the Worker class.

Worker ( string applicationName, long id, string name, QueueNameFilters queueFilters, int heartbeat, bool schedulerEnabled, IRepositoryFactory repositoryFactory, ILogger logger, IScheduler scheduler ) : System

Initializes a new instance of the Worker class.

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

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

Cancels the current job.

CreateHistory ( WorkingRecord working, HistoryStatus status ) : HistoryRecord

Creates a history record from the given working record and status.

CreateQueueRetry ( WorkingRecord working ) : QueueRecord

Creates a queue retry record from the given working record.

CreateWorking ( QueueRecord queued, long workerId, long scheduleId, System.DateTime startedOn ) : WorkingRecord

Creates a working record from the given queued record.

DequeueRecord ( ) : WorkingRecord

Dequeues a job to do work on.

Dispose ( bool disposing ) : void

Disposes of resources used by this instance.

ExecuteJob ( IJob job, Exception &ex ) : bool
KillRunThread ( ) : void
KillSignalThread ( ) : void
PruneOrphans ( ) : void

Prunes orphaned jobs assigned to this worker that for one reason or another didn't get marked as interrupted.

RunLoop ( ) : void
SetStatus ( WorkerStatus status ) : void

Sets this worker's status.

SetStatus ( WorkerStatus status, IRepository repository, IDbTransaction transaction ) : void

Sets this worker's status.

SignalLoop ( ) : void
Start ( ) : bool

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

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

Disposes of resources used by this instance.
public Dispose ( ) : void
Результат void

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

Stops the worker.
public Stop ( bool force ) : void
force bool A value indicating whether to force the worker to stop, even if work will be abandoned.
Результат void

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

Initializes a new instance of the Worker class.
public Worker ( string applicationName, long id, string name, QueueNameFilters queueFilters, int heartbeat, bool schedulerEnabled, IRepositoryFactory repositoryFactory, ILogger logger ) : System
applicationName string The name of the application the worker belongs to.
id long The ID of the worker in the repository.
name string The name of the worker.
queueFilters QueueNameFilters The queue name filters the worker should use while processing queues..
heartbeat int The number of seconds between poll intervals.
schedulerEnabled bool A value indicating whether the scheduler is enabled.
repositoryFactory IRepositoryFactory The repository factory to use when accessing data.
logger ILogger The logger to use when logging messages.
Результат System

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

Initializes a new instance of the Worker class.
public Worker ( string applicationName, long id, string name, QueueNameFilters queueFilters, int heartbeat, bool schedulerEnabled, IRepositoryFactory repositoryFactory, ILogger logger, IScheduler scheduler ) : System
applicationName string The name of the application the worker belongs to.
id long The ID of the worker in the repository.
name string The name of the worker.
queueFilters QueueNameFilters The queue name filters the worker should use while processing queues..
heartbeat int The number of seconds between poll intervals.
schedulerEnabled bool A value indicating whether the scheduler is enabled.
repositoryFactory IRepositoryFactory The repository factory to use when accessing data.
logger ILogger The logger to use when logging messages.
scheduler IScheduler The scheduler to use when managing schedules and enqueueing scheduled jobs.
Результат System