processServer: process batches of files from the queue

Description Usage Arguments Details Value Author(s)

Description

The queue consists of items in the MOTUS_PATH$QUEUE<N> folder. When the queue is empty, it is fed an item from the MOTUS_PATH$QUEUE0 folder, which receives processed email messages and directly moved folders.

Usage

1
processServer(N, tracing = FALSE)

Arguments

N

integer queue number. If in the range 1..8, this process will watch for new jobs in MOTUS_PATH$QUEUE0 and will store its operations in the folder MOTUS_PATH$QUEUEN If N >= 101, the process will watch for new jobs in MOTUS_PATH$PRIORITY. This is to allow high-priority jobs to run separately from those handling uploaded data. It's meant for manual runs on the server, and runs for small batches of data from attached receivers.

tracing

boolean scalar; if TRUE, enter the debugger before each handler is called

Details

Processing an item in the queue usually leads to more items being added to the queue, and these are processed in depth-first order; i.e. if X1 is a subjob of X and Y1 is a subjob of Y, and X was created before Y, and X1 and Y1 are both in the queue, then X1 will be processed before Y1, regardless of which was enqueued first.

Value

This function does not return; it is meant for use in an R script run in the background. After each subjob is handled, the function checks for the existence of a file called MOTUS_PATH$QUEUE0/killN or MOTUS_PATH$PRIORITY/killN (for N >= 101) If that file is found, the function calls quit(save="no"). The file will also be detected within the call to feed() when the queue is empty, because it is located in the watched folder.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


jbrzusto/motus-R-package documentation built on May 18, 2019, 7:03 p.m.