Interface IBackgroundWorker
Defines methods to do work in the background.
Namespace: Sartorius.SAF.Threading
Assembly: Sartorius.SAF.dll
Syntax
public interface IBackgroundWorker
Methods
View SourceDoWork(Action, Action<WorkerResult>)
Does the given work
in the background. When the work is done, the response
is invoked, if exists.
Declaration
void DoWork(Action work, Action<WorkerResult> response)
Parameters
Type | Name | Description |
---|---|---|
System.Action | work | The work to be done. |
System.Action<WorkerResult> | response | The response action that is invoked when the work is done. |
DoWork<T>(Func<T>, Action<WorkerResult<T>>)
Does the given work
in the background. When the work is done, the response
is invoked, if exists.
Declaration
void DoWork<T>(Func<T> work, Action<WorkerResult<T>> response)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T> | work | The work to be done. |
System.Action<WorkerResult<T>> | response | The response action that is invoked when the work is done. |
Type Parameters
Name | Description |
---|---|
T |