Ruby ruby 中 EM.system () 方法的疑惑请教大神们

shlallen · 2014年08月08日 · 2003 次阅读

exec_operation = proc do |process| …… end

exit_operation = proc do |_, status| …… end

Bundler.with_clean_env { EM.system("#{@ruby_path} -- #{prepare_script} true #{sh_command}", exec_operation, exit_operation) }

以上为代码部分:我想请教一下 EM.system("#{@ruby_path} -- #{prepare_script} true #{sh_command}", exec_operation, exit_operation) 的执行逻辑?

我现在的理解是肯定会去执行 exe_operation,貌似在 exec_operation 代码块中执行出问题的时候,会执行 exit_operation,请问是否是这样,或者具体的执行逻辑到底是怎么样的?

谢谢!

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号