From 5988b87c30eb0ce50c235187f5dfcfcfb98da01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 15 Oct 2009 14:49:29 -0300 Subject: Added parent_of? method to help tracing events. --- activesupport/lib/active_support/orchestra.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/orchestra.rb b/activesupport/lib/active_support/orchestra.rb index 96e6ce8865..5f57127401 100644 --- a/activesupport/lib/active_support/orchestra.rb +++ b/activesupport/lib/active_support/orchestra.rb @@ -112,6 +112,11 @@ module ActiveSupport @result = @payload.delete(:result) @duration = @payload.delete(:duration) end + + def parent_of?(event) + start = (self.time - event.time) * 1000 + start <= 0 && (start + self.duration >= event.duration) + end end # This is a default queue implementation that ships with Orchestra. It -- cgit v1.2.3