Guidelines
Description
🏹 Goal: Add option to track inputs via JavaScript.
How?
Shiny javascript events allow to detect input changing via JS (see snipped below)
This could replace existing logic in Telemetry$.log_all_inputs
Sending a message to R Shiny and processed by Telemetry class
Or see "Taking one step further"
$ (document ).on(' shiny:inputchanged' , function (event ) {
if (event.name === ' foo' ) {
event.value * = 2 ;
}
});
Benefits:
Performance improvements as the Shiny R session wouldn't be monitoring the input changes
Taking one step further
🏹 Goal: Delegate write operations to external API via JS
In other words, bypass using the DataStorage backend on the current R Shiny session and send the data to a deployment of the existing PlumberAPI
In turn, the Plumber API would write to the correct backend (LogFile, SQLite, SQL, ...)
Benefits:
Performance improvements as write operations would be done asynchronously in JS only
without blocking Shiny R session
Cons:
Less guarantees that data is being written as process becomes asynchronous
Requirement to have a Plumber API instance running
Additional work:
Need additional check to verify availability of Plumber API
Implement fallback to write data locally
Add documentation on how to reconcile data storages
Plumber API needs to be optimized to handle more queries per second (using {future} )
Diagram
Alternatives Considered
Using a queue system that allows to group together multiple events Use event queue to send messages to data storage #148
Guidelines
Description
🏹 Goal: Add option to track inputs via JavaScript.
How?
Telemetry$.log_all_inputsTelemetryclassBenefits:
Taking one step further
🏹 Goal: Delegate write operations to external API via JS
In other words, bypass using the DataStorage backend on the current R Shiny session and send the data to a deployment of the existing PlumberAPI
In turn, the Plumber API would write to the correct backend (LogFile, SQLite, SQL, ...)
Benefits:
Cons:
Additional work:
{future})Diagram
Alternatives Considered