Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class BackgroundTaskManager

An in-memory implementation of the IBackgroundTaskManager interface. This implementation does not persist queued tasks or messages, and queued tasks and progress messages will be lost when the application stops or the application pool is recycled.

Inheritance
System.Object
BackgroundTaskManager
Implements
EPiServer.Framework.IInitializableModule
Namespace: Mediachase.Commerce.BackgroundTasks
Assembly: Mediachase.Commerce.dll
Version: 14.26.0
Syntax
public class BackgroundTaskManager : Object, IBackgroundTaskManager, IInitializableModule

Constructors

BackgroundTaskManager()

Creates an instance of BackgroundTaskManager.

Declaration
public BackgroundTaskManager()

BackgroundTaskManager(BackgroundTaskMessageFactory)

Creates an instance of BackgroundTaskManager.

Declaration
public BackgroundTaskManager(BackgroundTaskMessageFactory defaultMessageFactory)
Parameters
Type Name Description
BackgroundTaskMessageFactory defaultMessageFactory

A factory for final messages added on task completion.

Methods

AddTask(IBackgroundTask)

Declaration
public virtual Guid AddTask(IBackgroundTask task)
Parameters
Type Name Description
IBackgroundTask task
Returns
Type Description
System.Guid

GetMessages(Guid)

Declaration
public virtual IList<IBackgroundTaskMessage> GetMessages(Guid taskId)
Parameters
Type Name Description
System.Guid taskId
Returns
Type Description
System.Collections.Generic.IList<IBackgroundTaskMessage>

GetMessages(Guid, Int32, Int32, out Int32, IEnumerable<BackgroundTaskMessageType>)

Declaration
public virtual IList<IBackgroundTaskMessage> GetMessages(Guid taskId, int offset, int count, out int totalCount, IEnumerable<BackgroundTaskMessageType> messageTypeFilter = null)
Parameters
Type Name Description
System.Guid taskId
System.Int32 offset
System.Int32 count
System.Int32 totalCount
System.Collections.Generic.IEnumerable<BackgroundTaskMessageType> messageTypeFilter
Returns
Type Description
System.Collections.Generic.IList<IBackgroundTaskMessage>

GetProgress(Guid)

Declaration
public virtual IBackgroundTaskMessage GetProgress(Guid taskId)
Parameters
Type Name Description
System.Guid taskId
Returns
Type Description
IBackgroundTaskMessage

Initialize(InitializationEngine)

Declaration
public void Initialize(InitializationEngine context)
Parameters
Type Name Description
EPiServer.Framework.Initialization.InitializationEngine context

QueryTasks(IEnumerable<Guid>, IEnumerable<Type>, IEnumerable<BackgroundTaskStatus>)

Declaration
public virtual IList<BackgroundTaskState> QueryTasks(IEnumerable<Guid> taskIds = null, IEnumerable<Type> taskTypes = null, IEnumerable<BackgroundTaskStatus> taskStatuses = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Guid> taskIds
System.Collections.Generic.IEnumerable<System.Type> taskTypes
System.Collections.Generic.IEnumerable<BackgroundTaskStatus> taskStatuses
Returns
Type Description
System.Collections.Generic.IList<BackgroundTaskState>

Uninitialize(InitializationEngine)

Declaration
public void Uninitialize(InitializationEngine context)
Parameters
Type Name Description
EPiServer.Framework.Initialization.InitializationEngine context

Implements

EPiServer.Framework.IInitializableModule