I\'m trying to fork a sub-process, wait for it to finish, if it doesn\'t finish within a certain amount of time, kill it.
This is what I have so far:
ser
Give a chance to subexec. From the README:
Subexec is a simple library that spawns an external command with an optional timeout parameter. It relies on Ruby 1.9's Process.spawn method. Also, it works with synchronous and asynchronous code.
Useful for libraries that are Ruby wrappers for CLI's. For example, resizing images with ImageMagick's mogrify command sometimes stalls and never returns control back to the original process. Enter Subexec.