You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: middleware_registry.rb
    path of file: ./repos/faraday/lib/faraday
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'monitor'

module Faraday
  # Adds the ability for other modules to register and lookup
  # middleware cla
    
    def load_middleware(key)
      value = registered_middleware[key]
      case value
      when Module
        value
      when Symbol, String
        middleware_mutex do
          @registered_middleware[key] = const_get(value)
        end
      when Proc
        middleware_mutex do
          @registered_middleware[key] = value.call
        end
      end