always require 'monitor' since it's used by AdapterRegistry too.

This commit is contained in:
rick olson 2019-03-05 11:38:07 -07:00
parent e8382421aa
commit dcb7030289

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'monitor'
module Faraday module Faraday
# Adds the ability for other modules to register and lookup # Adds the ability for other modules to register and lookup
# middleware classes. # middleware classes.
@ -83,10 +85,7 @@ module Faraday
end end
def middleware_mutex(&block) def middleware_mutex(&block)
@middleware_mutex ||= begin @middleware_mutex ||= Monitor.new
require 'monitor'
Monitor.new
end
@middleware_mutex.synchronize(&block) @middleware_mutex.synchronize(&block)
end end