mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
always require 'monitor' since it's used by AdapterRegistry too.
This commit is contained in:
parent
e8382421aa
commit
dcb7030289
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user