Show / Hide Table of Contents

Class WorkerBase

Base class for workers which implements default Worker workflow.

Inheritance
System.Object
WorkerBase
ActionWorker
RepeatableWorkerBase
Implements
IWorker
Namespace: Eco.Core.Utils.Threading
Assembly: Eco.Core.dll
Syntax
public abstract class WorkerBase : Object, IWorker

Constructors

WorkerBase()

Declaration
protected WorkerBase()

Methods

DoWork(CancellationToken)

Actual work performed in this method.

Declaration
protected abstract Task DoWork(CancellationToken token)
Parameters
Type Name Description
System.Threading.CancellationToken token
Returns
Type Description
System.Threading.Tasks.Task

ShutdownAsync()

Shutdowns worker by setting cancellation token Eco.Core.Utils.Threading.WorkerBase.cts and waiting for Eco.Core.Utils.Threading.WorkerBase.task to be completed.

Declaration
public Task ShutdownAsync()
Returns
Type Description
System.Threading.Tasks.Task

Start()

Starts worker with default System.Threading.Tasks.TaskFactory`1.

Declaration
public void Start()

Start(TaskFactory)

Starts worker with taskFactory System.Threading.Tasks.TaskFactory`1.

Declaration
public void Start(TaskFactory taskFactory)
Parameters
Type Name Description
System.Threading.Tasks.TaskFactory taskFactory

Implements

IWorker

Extension Methods

PropertyChanges.FirePropertyChanged(Object, String)
PropertyChanges.FirePropertyChanged(Object, String, Object, Object)
PropertyChanges.FirePropertyChanged(Object, MemberChangedBeforeAfterEventArgs)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾