Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

require monitor lazily

  • Loading branch information...
commit 0431614bfe0dd8fa6b4cc0f79255bc01bb9c28d8 1 parent 7e57b5e
@technoweenie authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/faraday.rb
View
6 lib/faraday.rb
@@ -181,7 +181,11 @@ def lookup_middleware(key)
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)
Please sign in to comment.
Something went wrong with that request. Please try again.