2015-12-07 38 views
0

我正在玩弄伟大的Tracepoint API,并且我在想是否可以将事件挂钩附加到使用popen3启动的ruby进程?Ruby Tracepoint - 将挂钩挂接到open3子进程

一个例子:

TracePoint.trace(:end) do |e| 
    # Here we do something like logging this event. 
end 


Open3.popen3(cmd) do |stdin, stdout, stderr, thread| 
    # cmd is a ruby cmd, and we want the tracepoint above to apply to it as well 
end 

任何想法?

+0

drb服务器是一种选择。 –

回答

0

没有解决方案popen3,但一个简单的exec伎俩。