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

Streams job output data from a file. More...

#include <FileOutputStream.hpp>

Inheritance diagram for rstudio::launcher_plugins::api::FileOutputStream:
rstudio::launcher_plugins::api::AbstractOutputStream

Public Member Functions

 FileOutputStream (OutputType in_outputType, api::JobPtr in_job, AbstractOutputStream::OnOutput in_onOutput, AbstractOutputStream::OnComplete in_onComplete, AbstractOutputStream::OnError in_onError, system::TimeDuration in_maxWaitTime=system::TimeDuration::Seconds(10))
 Constructor. More...
 
virtual ~FileOutputStream ()=default
 Virtual destructor for inheritance.
 
Error start () override
 Starts the output stream. More...
 
void stop () override
 Stops the output stream.
 
- Public Member Functions inherited from rstudio::launcher_plugins::api::AbstractOutputStream
virtual ~AbstractOutputStream ()=default
 Virtual destructor for inheritance.
 

Additional Inherited Members

- Public Types inherited from rstudio::launcher_plugins::api::AbstractOutputStream
typedef std::function< void(uint64_t)> OnComplete
 
typedef std::function< void(const Error &)> OnError
 
typedef std::function< void(const std::string &, OutputType, uint64_t)> OnOutput
 
- Protected Member Functions inherited from rstudio::launcher_plugins::api::AbstractOutputStream
 AbstractOutputStream (OutputType in_outputType, JobPtr in_job, OnOutput in_onOutput, OnComplete in_onComplete, OnError in_onError)
 Constructor. More...
 
void reportData (const std::string &in_data, OutputType in_outputType)
 Reports output to the launcher. More...
 
void reportError (const Error &in_error)
 Reports an error to the launcher. More...
 
void setStreamComplete ()
 Notifies the base class that the output stream has completed (i.e. all output of the specified type has been reported).
 
- Protected Attributes inherited from rstudio::launcher_plugins::api::AbstractOutputStream
OutputType m_outputType
 
JobPtr m_job
 

Detailed Description

Streams job output data from a file.

Constructor & Destructor Documentation

◆ FileOutputStream()

rstudio::launcher_plugins::api::FileOutputStream::FileOutputStream ( OutputType  in_outputType,
api::JobPtr  in_job,
AbstractOutputStream::OnOutput  in_onOutput,
AbstractOutputStream::OnComplete  in_onComplete,
AbstractOutputStream::OnError  in_onError,
system::TimeDuration  in_maxWaitTime = system::TimeDuration::Seconds(10) 
)

Constructor.

Parameters
in_outputTypeThe type of job output to stream.
in_jobThe job for which output should be streamed.
in_onOutputCallback function which will be invoked when data is reported.
in_onCompleteCallback function which will be invoked when the stream is complete.
in_onErrorCallback function which will be invoked if an error occurs.
in_maxWaitTimeThe maximum amount of time to wait for the output files to be created before reporting an error.

Member Function Documentation

◆ start()

Error rstudio::launcher_plugins::api::FileOutputStream::start ( )
overridevirtual

Starts the output stream.

Returns
Success if the stream could be started; Error otherwise.

Implements rstudio::launcher_plugins::api::AbstractOutputStream.


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