Skip to content

Commit d838eef

Browse files
authored
Add a note about polled events and the later package (#836)
* Add a note about polled events and the later package * Add additional note in `run_activity_handlers()` where we run `R_InputHandlers`
1 parent 5d31273 commit d838eef

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

crates/ark/src/interface.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,8 @@ impl RMain {
825825

826826
// Process R's polled events regularly while waiting for console input.
827827
// We used to poll every 200ms but that lead to visible delays for the
828-
// processing of plot events.
828+
// processing of plot events, it also slowed down callbacks from the later
829+
// package. 50ms seems to be more in line with RStudio (posit-dev/positron#7235).
829830
let polled_events_rx = crossbeam::channel::tick(Duration::from_millis(50));
830831

831832
let r_request_index = select.recv(&r_request_rx);

crates/ark/src/sys/unix/interface.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ pub fn run_activity_handlers() {
108108
//
109109
// We run this in a loop just to make sure the R help server can
110110
// be as responsive as possible when rendering help pages.
111+
//
112+
// Note that the later package also adds an input handler to `R_InputHandlers`
113+
// which runs the later event loop, so it's also important that we are fairly
114+
// responsive for that as well (posit-dev/positron#7235).
111115
let mut fdset = R_checkActivity(0, 1);
112116

113117
while fdset != std::ptr::null_mut() {

0 commit comments

Comments
 (0)