方法
- F
- I
- N
类公有方法
new(future_result, instrumenter) 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/future_result.rb, line 27 def initialize(future_result, instrumenter) @future_result = future_result @instrumenter = instrumenter @events = [] end
实例公有方法
flush() 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/future_result.rb, line 42 def flush events, @events = @events, [] events.each do |event| event.payload[:lock_wait] = @future_result.lock_wait ActiveSupport::Notifications.publish_event(event) end end
instrument(name, payload = {}, &block) 链接
源代码: 显示 | 在 GitHub 上
# File activerecord/lib/active_record/future_result.rb, line 33 def instrument(name, payload = {}, &block) event = @instrumenter.new_event(name, payload) begin event.record(&block) ensure @events << event end end