This seems a very useful module but would appreciate some guidance/documentation notes for how to get context to the finish callback.

In my app I am capturing some data input files details form the user in a form. On submit I store the input files as node fields in a node $nid and use background batch to process the files with an $operation call that calls a shell job using shell_exec. The shell script may then take hours to run and the user may log out whilst waiting. When the shell script completes I want to get the original $nid from within the batch finished callback (ie that was defined by batch_set($batch)) so I can add the results to the record of the input data. How do I pass $nid to the finished callback ?

Similarly if I want to check progress, for example when a user logs on, how do I get the ongoing status ?

Or should I use Background Process which returns $handle ?