Closed ianmiell closed 7 years ago
So, running a send in the background means:
adding a '&' to the end
capturing the pid (with $!)
poll the pid, then when done:
want to consider the possibility of multiple processes in the background to manage?
Branch 295 exists on cage.
Need to queue commands to run somehow.
send_background function:
- returns reference to the command object
- records command in memory in the shutit session
- boolean for whether to allow other backgrounds in one session (default no)
- there must be a newline (so no nonewline argument)
- Object:
- shutit.background_objects = []
- pid
- command
- return value
- other_background_commands_allowed
- timeout?
- start_time
- options to:
- cancel command
- get status (running, suspended etc)
- check_timeout ```
Now that standalone shutit sessions works, need to create a 'background task' handler that makes these calls asynchronous and well-handled:
Once that's done, managing multiple nodes with one scripts will be fast and easy.