module Shrine::Plugins::Parallelize

  1. lib/shrine/plugins/parallelize.rb

The parallelize plugin parallelizes uploads and deletes of multiple versions using threads.

plugin :parallelize

By default a pool of 3 threads will be used, but you can change that:

plugin :parallelize, threads: 5

Methods

Public Class

  1. configure
  2. load_dependencies

Public Class methods

configure (uploader, opts = {})
[show source]
# File lib/shrine/plugins/parallelize.rb, line 14
def self.configure(uploader, opts = {})
  uploader.opts[:parallelize_threads] = opts.fetch(:threads, uploader.opts.fetch(:parallelize_threads, 3))
end
load_dependencies (uploader, opts = {})
[show source]
# File lib/shrine/plugins/parallelize.rb, line 18
def self.load_dependencies(uploader, opts = {})
  uploader.plugin :hooks
end