Spawning an independent thread or process in Ruby

后端 未结 2 1196
时光取名叫无心
时光取名叫无心 2021-02-15 18:38

I may be approaching this in the wrong direction, so any help would be appreciated.

I have a Ruby script which, amongst other things, starts up an executable. I want to

2条回答
  •  我寻月下人不归
    2021-02-15 18:45

    detunized's answer should work on windows. This one is cross-platform:

    pid = spawn 'some_executable'
    Process.detach(pid) #tell the OS we're not interested in the exit status
    

提交回复
热议问题