0

I want to launch a subprocess in Ruby, concretely an external .exe file (I'm working in Windows environment). I don't want to block the Ruby script, so I want to return to the next line of the script while the subprocess is running. The Ruby script can even finish before the subprocess is done.

Is there any way to do it? I've tried exec(), fork(), spawn(), system()... but cannot make it work properly.

1 Answer 1

1

You could use Thread:

Thread.new { <your logic here> }

There are a bunch of helper methods defined on Thread which will allow you to monitor and manipulate the thread.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.