Implements a persistent executor/server for the remote process. Awaits data, evaluates an expression in an environment containing the supplied data, and returns the result to the caller/client.
server(
url,
asyncdial = TRUE,
maxtasks = Inf,
idletime = Inf,
walltime = Inf,
timerstart = 0L,
exitlinger = 1000L,
...,
cleanup = TRUE
)
the client or dispatcher URL to dial into as a character string, including the port to connect to and (optionally) a path for websocket URLs e.g. 'tcp://192.168.0.2:5555' or 'ws://192.168.0.2:5555/path'.
[default TRUE] whether to perform dials asynchronously. An
asynchronous dial is more resilient and will continue retrying if not
immediately successful. However this can mask potential connection issues
and specifying FALSE will error if a connection is not immediately
possible (e.g. daemons
has yet to be called on the client,
or the specified port is not open etc.).
[default Inf] the maximum number of tasks to execute (task limit) before exiting.
[default Inf] maximum idle time, since completion of the last task (in milliseconds) before exiting.
[default Inf] soft walltime, or the minimum amount of real time taken (in milliseconds) before exiting.
[default 0L] number of completed tasks after which to start the timer for 'idletime' and 'walltime'. 0L implies timers are started upon launch.
[default 1000L] time in milliseconds to linger before exiting due to a timer / task limit, to allow sockets to complete sends currently in progress. The default can be set wider if computations are expected to return very large objects (> GBs).
reserved but not currently used.
[default TRUE] logical value whether to perform cleanup of the global environment, options values and loaded packages after each task evaluation. This option should not be modified. Do not set to FALSE unless you are certain you want such persistence across evaluations.
Invisible NULL.
The network topology is such that server daemons dial into the client or dispatcher, which listens at the 'url' address. In this way, network resources may be added or removed dynamically and the client or dispatcher automatically distributes tasks to all available servers.