Sha256: 25c13fb3c39509ed8166e7f447415232ff1e50c3502123c668c414420ac7f8d8

Contents?: true

Size: 1.3 KB

Versions: 5

Compression:

Stored size: 1.3 KB

Contents

module Thinner

  # Thinner::Configuration holds the various settings for Thinner
  class Configuration

    attr_accessor :batch_length, :sleep_time, :server, :log_file, :no_kill

    # Create a Thinner::Configuration instance with sane defaults.
    def initialize
      # Number of urls to purge at one time. These purge requests are fired in quick
      # succession. Thinner is perfectly capable of killing a Varnish server, by
      # overloading the worker thread, so be really conservative with this option.
      @batch_length = 10

      # The amount of time to sleep between purges in seconds.
      @sleep_time   = 1

      # The server address and management port. See:
      #   http://www.varnish-cache.org/trac/wiki/ManagementPort
      # for details.
      @server       = "127.0.0.1:6082"

      # By default, every time you call Thinner.purge! thinner spins off a new
      # instance of Thinner::Client and terminates any old instances that are
      # running. If you want to have overlapping instances set this to true.
      # It's not recommended to have multiple Thinner::Client's running at the
      # same time.
      @no_kill      = false

      # The log file (either a string or file object) to log the current batch to.
      # Defaults to STDOUT
      @log_file     = STDOUT
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thinner-0.1.4 lib/thinner/configuration.rb
thinner-0.1.3 lib/thinner/configuration.rb
thinner-0.1.2 lib/thinner/configuration.rb
thinner-0.1.1 lib/thinner/configuration.rb
thinner-0.1.0 lib/thinner/configuration.rb