Methods

Class/Module Index [+]

Quicksearch

Backup::Syncer::Cloud::Base

Constants

MUTEX

Create a Mutex to synchronize certain parts of the code in order to prevent race conditions or broken STDOUT.

Attributes

concurrency_level[RW]

Concurrency level - the number of threads or processors to use. Defaults to 2.

concurrency_type[RW]

Concurrency setting - defaults to false, but can be set to:

  • :threads

  • :processes

Public Class Methods

new() click to toggle source

Instantiates a new Cloud Syncer object for either the Cloud::S3 or Cloud::CloudFiles Syncer.

Pre-configured defaults specified in either Configuration::Syncer::Cloud::S3 or Configuration::Syncer::Cloud::CloudFiles are set via a super() call to Syncer::Base.

If not specified in the pre-configured defaults, the Cloud specific defaults are set here before evaluating any block provided in the user's configuration file.

# File lib/backup/syncer/cloud/base.rb, line 41
def initialize
  super

  @concurrency_type  ||= false
  @concurrency_level ||= 2
end

Public Instance Methods

perform!() click to toggle source

Performs the Sync operation

# File lib/backup/syncer/cloud/base.rb, line 50
def perform!
  Logger.message(
    "#{ syncer_name } started the syncing process:\n" +
    "\s\sConcurrency: #{ @concurrency_type } Level: #{ @concurrency_level }"
  )

  @directories.each do |directory|
    SyncContext.new(
      File.expand_path(directory), repository_object, @path
    ).sync! @mirror, @concurrency_type, @concurrency_level
  end

  Logger.message("#{ syncer_name } Syncing Complete!")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.