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
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.BackgroundTasks
Assembly: Mediachase.Commerce.dll
Version: 10.8.0Syntax
public class BackgroundTaskManager : IRegisteredObject, IBackgroundTaskManager
Constructors
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 |
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> |
Implements
System.Web.Hosting.IRegisteredObject