RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Member Functions | Friends | List of all members
rstudio::launcher_plugins::jobs::JobStatusNotifier Class Referencefinal

Class which notifies subscribers when a job updates. More...

#include <JobStatusNotifier.hpp>

Inheritance diagram for rstudio::launcher_plugins::jobs::JobStatusNotifier:
rstudio::launcher_plugins::Noncopyable

Public Member Functions

 JobStatusNotifier ()
 Constructor.
 
SubscriptionHandle subscribe (const OnJobStatusUpdate &in_onJobStatusUpdate)
 Subscribes to all jobs. More...
 
SubscriptionHandle subscribe (const std::string &in_jobId, const OnJobStatusUpdate &in_onJobStatusUpdate)
 Subscribes to a specific job. More...
 
void updateJob (const api::JobPtr &in_job, api::Job::State in_newStatus, const std::string &in_statusMessage="", const system::DateTime &in_invocationTime=system::DateTime())
 Updates the status of a job with a new status and optionally a new status message. More...
 
- Public Member Functions inherited from rstudio::launcher_plugins::Noncopyable
 Noncopyable ()=default
 Default constructor.
 
 Noncopyable (const Noncopyable &)=delete
 Deleted copy constructor.
 
Noncopyableoperator= (const Noncopyable &)=delete
 Deleted assignment operator.
 

Friends

class Subscription
 

Detailed Description

Class which notifies subscribers when a job updates.

Member Function Documentation

◆ subscribe() [1/2]

SubscriptionHandle rstudio::launcher_plugins::jobs::JobStatusNotifier::subscribe ( const OnJobStatusUpdate &  in_onJobStatusUpdate)

Subscribes to all jobs.

Parameters
in_onJobStatusUpdateThe function to be invoked when any job is updated.
Returns
A handle to the job subscription. To end the subscription, allow the handle to fall out of scope.

◆ subscribe() [2/2]

SubscriptionHandle rstudio::launcher_plugins::jobs::JobStatusNotifier::subscribe ( const std::string &  in_jobId,
const OnJobStatusUpdate &  in_onJobStatusUpdate 
)

Subscribes to a specific job.

Parameters
in_jobIdThe ID of the job to subscribe to.
in_onJobStatusUpdateThe function to be invoked when the job is updated.
Returns
A handle to the job subscription. To end the subscription, allow the handle to fall out of scope.

◆ updateJob()

void rstudio::launcher_plugins::jobs::JobStatusNotifier::updateJob ( const api::JobPtr &  in_job,
api::Job::State  in_newStatus,
const std::string &  in_statusMessage = "",
const system::DateTime in_invocationTime = system::DateTime() 
)

Updates the status of a job with a new status and optionally a new status message.

Parameters
in_jobThe job to be updated.
in_newStatusThe new status of the job.
in_statusMessageThe new status message of the job. Default: "".
in_invocationTimeThe time at which this method was invoked. Default: Current Time. If there is concern about time differences between the RStudio Launcher Host and the Job Scheduling System, this may be overridden with the time from the point of view of the Job Scheduling System.

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