ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reusex::pipeline::JobScheduler Class Reference

The worker pool. Safe to use from any thread. More...

#include <JobScheduler.hpp>

Public Member Functions

 JobScheduler (JobSchedulerOptions options={}, std::shared_ptr< IJobStore > store=nullptr)
 ~JobScheduler ()
 Cancels every queued job (reported as cancelled), asks every running job to stop, and joins the workers.
 JobScheduler (const JobScheduler &)=delete
JobScheduler & operator= (const JobScheduler &)=delete
std::unique_ptr< JobQueue > make_queue (std::string key, std::filesystem::path project, StageExecutor executor=default_stage_executor())
 A new queue for project.
std::size_t workers () const noexcept
std::size_t running_count () const
 Jobs executing right now, across every queue.
std::shared_ptr< IJobStore > store () const
 The store records are written to.

Detailed Description

The worker pool. Safe to use from any thread.

Definition at line 56 of file JobScheduler.hpp.

Constructor & Destructor Documentation

◆ JobScheduler() [1/2]

reusex::pipeline::JobScheduler::JobScheduler ( JobSchedulerOptions options = {},
std::shared_ptr< IJobStore > store = nullptr )
explicit
Parameters
storeWhere job records go; nullptr = a fresh InMemoryJobStore.

Referenced by JobScheduler(), and operator=().

◆ ~JobScheduler()

reusex::pipeline::JobScheduler::~JobScheduler ( )

Cancels every queued job (reported as cancelled), asks every running job to stop, and joins the workers.

Queues may outlive the scheduler; they then refuse new submissions.

◆ JobScheduler() [2/2]

reusex::pipeline::JobScheduler::JobScheduler ( const JobScheduler & )
delete

References JobScheduler().

Member Function Documentation

◆ make_queue()

std::unique_ptr< JobQueue > reusex::pipeline::JobScheduler::make_queue ( std::string key,
std::filesystem::path project,
StageExecutor executor = default_stage_executor() )

A new queue for project.

key names it in the job store (ruxd uses the case id) and must be unique among this scheduler's live queues.

Exceptions
std::invalid_argumentfor an empty key, a key already in use, or an executor that is not callable.

References reusex::pipeline::default_stage_executor().

◆ operator=()

JobScheduler & reusex::pipeline::JobScheduler::operator= ( const JobScheduler & )
delete

References JobScheduler().

◆ running_count()

std::size_t reusex::pipeline::JobScheduler::running_count ( ) const

Jobs executing right now, across every queue.

References running_count().

Referenced by running_count().

◆ store()

std::shared_ptr< IJobStore > reusex::pipeline::JobScheduler::store ( ) const

The store records are written to.

References store().

Referenced by store().

◆ workers()

std::size_t reusex::pipeline::JobScheduler::workers ( ) const
noexcept

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