Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BackgroundWorker Class Reference
Inheritance diagram for BackgroundWorker:

Public Types

enum class  RunOneResult : int { NoTasks = 0 , TaskExecuted = 1 , Retry = 2 }
enum class  State : int { Initializing = 0 , Off = 1 , Running = 2 }
using SortingJobQueue
using TaskPipe = ::SPSCQueue<::std::shared_ptr<::BackgroundTaskBase>, 512>

Public Member Functions

BackgroundWorker & operator= (BackgroundWorker const &)
 BackgroundWorker (BackgroundWorker const &)
virtual bool isAsync () const
virtual bool canTaskRunAgain () const
MCAPI BackgroundWorker (::std::string_view name, ::Core::Profile::ThreadFrameType frameType, bool async, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > const coreAffinity, ::std::optional< int > const idealCore, ::WorkerPool &workerPool)
MCAPI bool _processNextTask (::RunTaskOptions const &options)
MCAPI void queue (::std::shared_ptr<::BackgroundTaskBase > task)
MCAPI void requestStop (bool wait)
MCAPI void start ()
MCAPI void * $ctor (::std::string_view name, ::Core::Profile::ThreadFrameType frameType, bool async, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > const coreAffinity, ::std::optional< int > const idealCore, ::WorkerPool &workerPool)
MCAPI bool $isAsync () const
MCAPI bool $canTaskRunAgain () const

Public Attributes

::ll::TypedStorage< 1, 1, bool const > mAsync
::ll::TypedStorage< 4, 4, ::Bedrock::Threading::OSThreadPriority > mPriority
::ll::TypedStorage< 8, 16, ::std::optional< uint64 > > mCoreAffinity
::ll::TypedStorage< 4, 8, ::std::optional< int > > mIdealCore
::ll::TypedStorage< 8, 32, ::std::string > mName
::ll::TypedStorage< 1, 1, ::Core::Profile::ThreadFrameType > mFrameType
::ll::TypedStorage< 8, 16, ::std::thread > mThread
::ll::TypedStorage< 4, 4, ::std::thread::id > mWorkerThreadID
::ll::TypedStorage< 4, 4, ::std::atomic<::BackgroundWorker::State > > mState
::ll::TypedStorage< 8, 160, ::ResetEventObj > mResetEvent
::ll::TypedStorage< 1, 1, ::std::atomic< bool > > mIdle
::ll::TypedStorage< 8, 8, ::std::chrono::steady_clock::time_point > mIdleSinceTime
::ll::TypedStorage< 8, 16, ::std::shared_ptr<::BackgroundTaskBase > > mCurrentTask
::ll::TypedStorage< 8, 8, ::WorkerPool & > mWorkerPool
::ll::TypedStorage< 8, 8, ::std::chrono::nanoseconds > mMaxSpinlockDuration
::ll::TypedStorage< 8, 360, ::BackgroundTaskQueue > mTaskQueue

Member Typedef Documentation

◆ SortingJobQueue

using BackgroundWorker::SortingJobQueue

Constructor & Destructor Documentation

◆ BackgroundWorker()

MCAPI BackgroundWorker::BackgroundWorker ( ::std::string_view name,
::Core::Profile::ThreadFrameType frameType,
bool async,
::Bedrock::Threading::OSThreadPriority const & priority,
::std::optional< uint64 > const coreAffinity,
::std::optional< int > const idealCore,
::WorkerPool & workerPool )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

Member Function Documentation

◆ isAsync()

virtual bool BackgroundWorker::isAsync ( ) const
virtual

Implements ITaskExecutionContext.

◆ canTaskRunAgain()

virtual bool BackgroundWorker::canTaskRunAgain ( ) const
virtual

Implements ITaskExecutionContext.

◆ _processNextTask()

MCAPI bool BackgroundWorker::_processNextTask ( ::RunTaskOptions const & options)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ queue()

MCAPI void BackgroundWorker::queue ( ::std::shared_ptr<::BackgroundTaskBase > task)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ requestStop()

MCAPI void BackgroundWorker::requestStop ( bool wait)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ start()

MCAPI void BackgroundWorker::start ( )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $ctor()

MCAPI void * BackgroundWorker::$ctor ( ::std::string_view name,
::Core::Profile::ThreadFrameType frameType,
bool async,
::Bedrock::Threading::OSThreadPriority const & priority,
::std::optional< uint64 > const coreAffinity,
::std::optional< int > const idealCore,
::WorkerPool & workerPool )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $isAsync()

MCAPI bool BackgroundWorker::$isAsync ( ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $canTaskRunAgain()

MCAPI bool BackgroundWorker::$canTaskRunAgain ( ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

The documentation for this class was generated from the following file: