uploadServer: watch for and enqueue uploaded files

Description Usage Arguments Value Note Author(s)

Description

Watch for new files in MOTUS_PATH$UPLOADS; and when a new file is found, queue a job to process it.

Usage

1
uploadServer(tracing = FALSE, fileEvent = "CREATE")

Arguments

tracing

logical scalar, default FALSE. If TRUE, enter debug browser before handling each new file upload.

fileEvent

character scalar; default: "CREATE". The last filesystem event generated by the external program which is placing files in the MOTUS_PATH$UPLOADS folder. For other upload systems, the appropriate event might be "CLOSE_WRITE" or "MOVED_TO". The event should only occur once per uploaded file and only after the full file contents are available.

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$UPLOADS/kill. 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.

Note

this depends on some other process placing uploaded files into the folder MOTUS_PATH$UPLOADS. We're using a patched version of http://www.projectsend.org whose last task for an uploaded file is to create a symlink to it in MOTUS_PATH$UPLOADS, and this generates a "CREATE" event.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


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