Class TimerWorkerBase
Provides a base implementation for application workers.
Inherited Members
Namespace: Swan.Threading
Syntax
public abstract class TimerWorkerBase : WorkerBase, IWorker, IDisposable
Constructors
TimerWorkerBase(String, TimeSpan)
Initializes a new instance of the TimerWorkerBase class.
Declaration
protected TimerWorkerBase(string name, TimeSpan period)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name. |
TimeSpan | period | The execution interval. |
Methods
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
|
Overrides
PauseAsync()
Declaration
public override Task<WorkerState> PauseAsync()
Returns
Type | Description |
---|---|
Task<WorkerState> |
Overrides
ResumeAsync()
Declaration
public override Task<WorkerState> ResumeAsync()
Returns
Type | Description |
---|---|
Task<WorkerState> |
Overrides
ScheduleCycle(Int32)
Schedules a new cycle for execution. The delay is given in milliseconds. Passing a delay of 0 means a new cycle should be executed immediately.
Declaration
protected void ScheduleCycle(int delay)
Parameters
Type | Name | Description |
---|---|---|
Int32 | delay | The delay. |
StartAsync()
Declaration
public override Task<WorkerState> StartAsync()
Returns
Type | Description |
---|---|
Task<WorkerState> |
Overrides
StopAsync()
Declaration
public override Task<WorkerState> StopAsync()
Returns
Type | Description |
---|---|
Task<WorkerState> |