RStudio Launcher Plugin SDK
1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
|
Manages the sending of streamed responses. More...
#include <AbstractMultiStream.hpp>
Public Member Functions | |
AbstractMultiStream (comms::AbstractLauncherCommunicatorPtr in_launcherCommunicator) | |
Constructor. More... | |
virtual void | addRequest (uint64_t in_requestId, const system::User &in_requestUser)=0 |
Adds a request to the stream. More... | |
virtual Error | initialize ()=0 |
Initializes the response stream. More... | |
bool | isEmpty () const |
Checks whether there are any requests listening to this stream. More... | |
virtual void | removeRequest (uint64_t in_requestId) |
Removes a request from the multi-stream response. More... | |
Public Member Functions inherited from rstudio::launcher_plugins::Noncopyable | |
Noncopyable ()=default | |
Default constructor. | |
Noncopyable (const Noncopyable &)=delete | |
Deleted copy constructor. | |
Noncopyable & | operator= (const Noncopyable &)=delete |
Deleted assignment operator. | |
Protected Member Functions | |
void | onAddRequest (uint64_t in_requestId) |
Adds a new request ID to the multi-stream response. More... | |
void | onRemoveRequest (uint64_t in_requestId) |
Removes a request from the multi-stream response. More... | |
void | sendResponse (Args... in_responseArgs) |
Sends a response to the Launcher for all requests. More... | |
void | sendResponse (const std::set< uint64_t > &in_requestIds, Args... in_responseArgs) |
Sends a response to the Launcher for the specified requests. More... | |
Protected Attributes | |
std::mutex | m_mutex |
Manages the sending of streamed responses.
R | The Response type which should be sent. |
Args | The additional constructor parameters of R, besides the request and sequence IDs. |
|
explicit |
Constructor.
in_launcherCommunicator | The launcher communicator which will send the responses. |
|
pure virtual |
Adds a request to the stream.
in_requestId | The ID of the request. |
in_requestUser | The user who made the request. |
Implemented in rstudio::launcher_plugins::api::AbstractResourceStream.
|
pure virtual |
Initializes the response stream.
Implemented in rstudio::launcher_plugins::api::AbstractResourceStream, rstudio::launcher_plugins::api::AbstractTimedResourceStream, and rstudio::launcher_plugins::quickstart::QuickStartResourceStream.
bool rstudio::launcher_plugins::api::AbstractMultiStream< R, Args >::isEmpty | ( | ) | const |
Checks whether there are any requests listening to this stream.
|
protected |
Adds a new request ID to the multi-stream response.
NOTE: The mutex must be held when this is called.
in_requestId | The request ID which is listening to this response stream. |
|
protected |
Removes a request from the multi-stream response.
NOTE: The mutex must be held when this is called.
in_requestId | The request ID which has stopped listening to this response stream. |
|
virtual |
Removes a request from the multi-stream response.
in_requestId | The request ID which has stopped listening to this response stream. |
|
protected |
Sends a response to the Launcher for all requests.
NOTE: The mutex must be held when this is called.
in_responseArgs | The details of the response, if any. |
|
protected |
Sends a response to the Launcher for the specified requests.
NOTE: The mutex must be held when this is called.
in_requestIds | Sends the response only for the specified request IDs. |
in_responseArgs | The details of the response, if any. |
|
mutableprotected |
Mutex to protect shared state of the stream.