File: net_http_persistent.rb

package info (click to toggle)
ruby-faraday-net-http-persistent 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80 kB
  • sloc: ruby: 193; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 808 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

require "faraday"
require "faraday/adapter/net_http_persistent"
require "faraday/net_http_persistent/version"

module Faraday
  module NetHttpPersistent
    # Faraday allows you to register your middleware for easier configuration.
    # This step is totally optional, but it basically allows users to use a custom symbol (in this case, `:net_http_persistent`),
    # to use your adapter in their connections.
    # After calling this line, the following are both valid ways to set the adapter in a connection:
    # * conn.adapter Faraday::Adapter::NetNttpPersistent
    # * conn.adapter :net_http_persistent
    # Without this line, only the former method is valid.
    Faraday::Adapter.register_middleware(net_http_persistent: Faraday::Adapter::NetHttpPersistent)
  end
end