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