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
任何想法?
drb服務器是一種選擇。 –