start_update_feed_server: Start the local update feed server

View source: R/update-feed.R

start_update_feed_serverR Documentation

Start the local update feed server

Description

Runs update-feed-server.js with Node.js to serve dir on ⁠127.0.0.1⁠ at a free port, and waits for the address it prints.

Usage

start_update_feed_server(dir, timeout = 10)

Arguments

dir

Folder to serve.

timeout

Seconds to wait for the address.

Details

The server does not outlive the R session that started it. It is started and held with interrupts suspended, so from then on an error or an interrupt before its address arrives kills it here, and stop_update_feed_server() kills it later. Supervision is set up after that, since it can take a moment the first time and can fail; a failure ends the server and is reported as such. If the returned list is garbage collected, processx kills the server, so keep the list for as long as the feed is in use. If R exits or dies without running exit handlers, processx's supervisor kills the server, and the server also exits by itself once R's end of its standard input closes. Only R holds that end: processx keeps it from being inherited by any other child process.

Value

A list with process, the processx::process running the server, and url, its address, such as "http://127.0.0.1:43210/".


shinyelectron documentation built on Dec. 3, 2026, 9:07 a.m.