Interface IAimpServiceThreadPool
Service provides an access to thread pool and allows to plugin add a task to asynchronous execution. Note that count of running threads at same time is limited. All tasks will be added to special queue and will be executed when one of the threads is idle.
Make sure that all your tasks is completed or canceled during plugin finalization.
Implements the IAimpServiceInherited Members
Namespace: AIMP.SDK.Threading
Assembly: AIMP.SDK.dll
Syntax
[Obsolete("Use IAimpServiceThreads")]
public interface IAimpServiceThreadPool : IAimpService
Methods
Cancel(UIntPtr, AimpServiceThreadPoolType)
Cancels the specified task.
Declaration
AimpActionResult Cancel(UIntPtr taskHandle, AimpServiceThreadPoolType flags)
Parameters
Type | Name | Description |
---|---|---|
System.UIntPtr | taskHandle | The task handle. |
AimpServiceThreadPoolType | flags | The flags. |
Execute(IAimpTask)
Executes the specified task.
Declaration
AimpActionResult<UIntPtr> Execute(IAimpTask task)
Parameters
Type | Name | Description |
---|---|---|
IAimpTask | task | The task. |
WaitFor(UIntPtr)
Method provides an ability to wait for task completion.
Declaration
AimpActionResult WaitFor(UIntPtr taskHandle)
Parameters
Type | Name | Description |
---|---|---|
System.UIntPtr | taskHandle | The task handle. |