mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-19 00:04:27 -04:00
require monitor lazily
This commit is contained in:
parent
7e57b5eb2b
commit
0431614bfe
@ -181,7 +181,11 @@ module Faraday
|
|||||||
end
|
end
|
||||||
|
|
||||||
def middleware_mutex(&block)
|
def middleware_mutex(&block)
|
||||||
(@middleware_mutex ||= Monitor.new).synchronize(&block)
|
@middleware_mutex ||= begin
|
||||||
|
require 'monitor'
|
||||||
|
Monitor.new
|
||||||
|
end
|
||||||
|
@middleware_mutex.synchronize(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_middleware(key)
|
def fetch_middleware(key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user