Class: Thinner::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/thinner/configuration.rb

Overview

Thinner::Configuration holds the various settings for Thinner

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Configuration) initialize

Create a Thinner::Configuration instance with sane defaults.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/thinner/configuration.rb', line 9

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

Instance Attribute Details

- (Object) batch_length

Returns the value of attribute batch_length



6
7
8
# File 'lib/thinner/configuration.rb', line 6

def batch_length
  @batch_length
end

- (Object) log_file

Returns the value of attribute log_file



6
7
8
# File 'lib/thinner/configuration.rb', line 6

def log_file
  @log_file
end

- (Object) no_kill

Returns the value of attribute no_kill



6
7
8
# File 'lib/thinner/configuration.rb', line 6

def no_kill
  @no_kill
end

- (Object) server

Returns the value of attribute server



6
7
8
# File 'lib/thinner/configuration.rb', line 6

def server
  @server
end

- (Object) sleep_time

Returns the value of attribute sleep_time



6
7
8
# File 'lib/thinner/configuration.rb', line 6

def sleep_time
  @sleep_time
end