aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/orchestra.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/orchestra.rb')
-rw-r--r--activesupport/lib/active_support/orchestra.rb5
1 files changed, 5 insertions, 0 deletions
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