#include <JobSystem.h>
Definition at line 25 of file JobSystem.h.
◆ JobSystem() [1/3]
Create a generic job system.
- Parameters
-
| errorReporter | Reporter used for background job diagnostics. |
| workers | Worker count for the scheduler. |
Definition at line 55 of file JobSystem.cpp.
◆ ~JobSystem()
| core::jobs::JobSystem::~JobSystem |
( |
| ) |
|
|
default |
◆ JobSystem() [2/3]
| core::jobs::JobSystem::JobSystem |
( |
const JobSystem & | | ) |
|
|
delete |
Copying a job system is disabled.
◆ JobSystem() [3/3]
| core::jobs::JobSystem::JobSystem |
( |
JobSystem && | other | ) |
|
|
defaultnoexcept |
Move a job system facade.
- Parameters
-
| other | Job system to move from. |
◆ cancel()
| void core::jobs::JobSystem::cancel |
( |
const JobId & | id | ) |
|
◆ cancelFlag()
| std::shared_ptr< std::atomic< bool > > core::jobs::JobSystem::cancelFlag |
( |
const JobId & | id | ) |
const |
|
nodiscard |
Retrieve a job cancellation flag.
- Parameters
-
- Returns
- Shared cancellation flag, or null when the job is unknown.
Definition at line 92 of file JobSystem.cpp.
◆ fail()
| void core::jobs::JobSystem::fail |
( |
const JobId & | id, |
|
|
const std::string & | error ) |
Mark a job as failed.
- Parameters
-
| id | Job identifier. |
| error | Error message to store and publish. |
Definition at line 82 of file JobSystem.cpp.
◆ finish()
| void core::jobs::JobSystem::finish |
( |
const JobId & | id | ) |
|
Mark a job as finished.
- Parameters
-
Definition at line 87 of file JobSystem.cpp.
◆ operator=() [1/2]
Copy-assigning a job system is disabled.
- Returns
- Reference to this job system.
◆ operator=() [2/2]
Move-assign a job system facade.
- Parameters
-
| other | Job system to move from. |
- Returns
- Reference to this job system.
◆ pause()
| void core::jobs::JobSystem::pause |
( |
const JobId & | id | ) |
|
◆ pauseFlag()
| std::shared_ptr< std::atomic< bool > > core::jobs::JobSystem::pauseFlag |
( |
const JobId & | id | ) |
const |
|
nodiscard |
Retrieve a job pause flag.
- Parameters
-
- Returns
- Shared pause flag, or null when the job is unknown.
Definition at line 97 of file JobSystem.cpp.
◆ publish()
| void core::jobs::JobSystem::publish |
( |
const JobEvent & | event | ) |
|
Publish a job event to subscribers and update its snapshot.
- Parameters
-
Definition at line 77 of file JobSystem.cpp.
◆ resume()
| void core::jobs::JobSystem::resume |
( |
const JobId & | id | ) |
|
◆ scheduler()
| Scheduler & core::jobs::JobSystem::scheduler |
( |
| ) |
|
|
nodiscard |
Access the shared worker scheduler.
- Returns
- Scheduler used for background job work.
Definition at line 102 of file JobSystem.cpp.
◆ shutdown()
| void core::jobs::JobSystem::shutdown |
( |
| ) |
|
◆ slotLimiter()
Access the shared slot limiter.
- Returns
- Slot limiter for scarce external resources.
Definition at line 107 of file JobSystem.cpp.
◆ snapshot()
| std::optional< JobSnapshot > core::jobs::JobSystem::snapshot |
( |
const JobId & | id | ) |
const |
Retrieve a job snapshot.
- Parameters
-
- Returns
- Job snapshot, if the job exists.
Definition at line 137 of file JobSystem.cpp.
◆ start()
| void core::jobs::JobSystem::start |
( |
const JobId & | id | ) |
|
Mark a job as running.
- Parameters
-
Definition at line 72 of file JobSystem.cpp.
◆ submit()
Create a new tracked job.
- Parameters
-
| kind | Kind of job to submit. |
- Returns
- Identifier of the created job.
Definition at line 67 of file JobSystem.cpp.
◆ subscribe()
Subscribe to job events.
- Parameters
-
| id | Job identifier. |
| cb | Event callback. |
- Returns
- Subscription identifier.
Definition at line 112 of file JobSystem.cpp.
◆ unsubscribe()
Unsubscribe from job events.
- Parameters
-
| id | Job identifier. |
| subId | Subscription identifier. |
Definition at line 117 of file JobSystem.cpp.
The documentation for this class was generated from the following files: