Sha256: 11a62ea1e36ffb04d5da7f6f3b4f19d7914d5019898e18e701f850dd0faa20b2

Contents?: true

Size: 819 Bytes

Versions: 38

Compression:

Stored size: 819 Bytes

Contents

module Algolia
  module Transport
    class StatefulHost
      include CallType

      attr_reader :url, :protocol, :accept, :port
      attr_accessor :last_use, :retry_count, :up

      # @param url [String] host url
      # @option options [binary] :accept accept type flag
      # @option options [DateTime] :last_use last usage date
      # @option options [Integer] :retry_count number of retries
      # @option options [Boolean] :up host status
      #
      def initialize(url, opts = {})
        @url = url
        @protocol = opts[:protocol] || "https://"
        @port = opts[:port]
        @accept = opts[:accept] || (READ | WRITE)
        @last_use = opts[:last_use] || Time.now.utc
        @retry_count = opts[:retry_count] || 0
        @up = opts.key?(:up) ? opts[:up] : true
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
algolia-3.12.0 lib/algolia/transport/stateful_host.rb
algolia-3.11.0 lib/algolia/transport/stateful_host.rb
algolia-3.10.2 lib/algolia/transport/stateful_host.rb
algolia-3.10.1 lib/algolia/transport/stateful_host.rb
algolia-3.8.2 lib/algolia/transport/stateful_host.rb
algolia-3.8.1 lib/algolia/transport/stateful_host.rb
algolia-3.8.0 lib/algolia/transport/stateful_host.rb
algolia-3.7.1 lib/algolia/transport/stateful_host.rb
algolia-3.7.0 lib/algolia/transport/stateful_host.rb
algolia-3.6.0 lib/algolia/transport/stateful_host.rb
algolia-3.5.4 lib/algolia/transport/stateful_host.rb
algolia-3.5.3 lib/algolia/transport/stateful_host.rb
algolia-3.5.2 lib/algolia/transport/stateful_host.rb
algolia-3.5.1 lib/algolia/transport/stateful_host.rb
algolia-3.5.0 lib/algolia/transport/stateful_host.rb
algolia-3.4.0 lib/algolia/transport/stateful_host.rb
algolia-3.3.4 lib/algolia/transport/stateful_host.rb
algolia-3.3.3 lib/algolia/transport/stateful_host.rb
algolia-3.3.2 lib/algolia/transport/stateful_host.rb
algolia-3.3.1 lib/algolia/transport/stateful_host.rb