class ProjectLibraryWorker

Performs async project library operations.

Public

Constructors

ProjectLibraryWorker

ProjectLibraryWorker()

Methods

~ProjectLibraryWorker

~ProjectLibraryWorker() noexcept

TryStartOperation

TResult<u32> TryStartOperation(const SPtr<ProjectLibraryOperation> &operation)

Attempts to queue the operation for execution on the worker.

Returns success or failure along with error message. If failed, nothing will be executed on the worker thread. If successful, returns a unique ID of the operation.

BlockUntilIdle

void BlockUntilIdle()

Blocks the calling thread until the worker has completed all operations.

GetActiveOperationCount

u32 GetActiveOperationCount() const

Returns number of operations that are currently in progress.

Fields

OnOperationFinished

Event<void (u32)> OnOperationFinished

Event that triggers when an operation finishes executing.

Called on the main thread. Provides operation ID as the parameter.

Private

Fields

mAsyncOperationQueue

SchedulerTicketQueue mAsyncOperationQueue

mFinalizeOperationQueue

SchedulerTicketQueue mFinalizeOperationQueue

mQueuedAsyncOperations

Queue<SchedulerTicket> mQueuedAsyncOperations

mQueuedFinalizeOperations

Queue<SchedulerTicket> mQueuedFinalizeOperations

mAsyncOperationMutex

Mutex mAsyncOperationMutex

mFinalizeOperationMutex

Mutex mFinalizeOperationMutex

mAsyncOperationCompletedSignal

Signal mAsyncOperationCompletedSignal

mFinalizeOperationCompletedSignal

Signal mFinalizeOperationCompletedSignal

mNextOperationId

u32 mNextOperationId