Interface IProcessWorker
Interface defines the functionality of a process worker.
Namespace: Cireson.Core.Interfaces.Services.WorkerProcessing.Workers
Assembly: Cireson.Core.Interfaces.dll
Syntax
public interface IProcessWorker : IWorkerProcess, IDisposable
Remarks
Admin, 8/24/2017.
Properties
View SourceAllowMultipleInstances
Gets or sets a value indicating whether [allow multiple instances].
Declaration
bool AllowMultipleInstances { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Enabled
Gets or sets a value indicating whether this IProcessWorker is enabled.
Declaration
bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
HeartbeatTimeout
Gets or sets the heartbeat timeout.
Declaration
int HeartbeatTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The heartbeat timeout. |
State
Gets the state.
Declaration
ProcessWorkerState State { get; }
Property Value
Type | Description |
---|---|
ProcessWorkerState | The state. |
Methods
View SourceProcessStartedAsync()
This method is called when the worker process starts.
Declaration
Task ProcessStartedAsync()
Returns
Type | Description |
---|---|
Task | An asynchronous result. |
ProcessStartingAsync()
Called when the worker manager is preparing to start the process. Initialization should be called here.
Declaration
Task ProcessStartingAsync()
Returns
Type | Description |
---|---|
Task | An asynchronous result. |
ProcessStoppedAsync()
Called when a worker process has completed the stopping state, and is considered stopped by the worker manager. no further processing should happen.
Declaration
Task ProcessStoppedAsync()
Returns
Type | Description |
---|---|
Task | An asynchronous result. |
ProcessStoppingAsync()
This method is called when the process is shutting down. Cleanup tasks should be done here.
Declaration
Task ProcessStoppingAsync()
Returns
Type | Description |
---|---|
Task | An asynchronous result. |
RestartProcess()
sends a message to process manager to initiate a restart of this worker process.
Declaration
void RestartProcess()
StartProcess()
Sends a message to process manager to initiate a start of this worker process.
Declaration
void StartProcess()
StopProcess()
Sends message to process manager to initiate a stop of this worker process.
Declaration
void StopProcess()
Events
View SourceOnRestartRequested
Occurs when [on restart requested].
Declaration
event EventHandler<ProcessWorkerEventArgs> OnRestartRequested
Event Type
Type | Description |
---|---|
EventHandler<ProcessWorkerEventArgs> |
OnStartRequested
Occurs when [on start requested].
Declaration
event EventHandler<ProcessWorkerEventArgs> OnStartRequested
Event Type
Type | Description |
---|---|
EventHandler<ProcessWorkerEventArgs> |
OnStopRequested
Occurs when [on stop requested].
Declaration
event EventHandler<ProcessWorkerEventArgs> OnStopRequested
Event Type
Type | Description |
---|---|
EventHandler<ProcessWorkerEventArgs> |