Class AsyncThreadedWorkerService<OperationType>
Threaded worker service which can perform operations asynchronously on other threads
Inheritance
object
AsyncThreadedWorkerService<OperationType>
Namespace: i5.Toolkit.Core.ServiceCore
Assembly: cs.temp.dll.dll
Syntax
public class AsyncThreadedWorkerService<OperationType> : IUpdateableService, IService where OperationType : IOperation
Type Parameters
Name | Description |
---|---|
OperationType | The type of operation that should be performed |
Properties
Enabled
If set to true, the update routine will run every frame
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddOperation(OperationType)
Adds an operation to the queue of operations to execute on a separate thread
Declaration
public void AddOperation(OperationType operation)
Parameters
Type | Name | Description |
---|---|---|
OperationType | operation | The operation which should be executed |
AsyncOperation(OperationType)
Declaration
protected virtual void AsyncOperation(OperationType operation)
Parameters
Type | Name | Description |
---|---|---|
OperationType | operation |
Cleanup()
Called by the ServiceManager to clean the service up when it is removed
Declaration
public void Cleanup()
Initialize(IServiceManager)
Called by the ServiceManager to initialize the service
Declaration
public void Initialize(IServiceManager owner)
Parameters
Type | Name | Description |
---|---|---|
IServiceManager | owner |
Update()
Called by the ServiceManager every frame If there is an operation waiting to be executed, it will be started If there are finished operations available, their callback method is called
Declaration
public void Update()