Sha256: 4fa3e870145816998ebef6cf06e0db61f95d9427f6363274e198e2f50d7d36f8

Contents?: true

Size: 1010 Bytes

Versions: 24

Compression:

Stored size: 1010 Bytes

Contents

require "active_support/concern"

module RocketJob
  module Batch
    module Callbacks
      extend ActiveSupport::Concern
      include ActiveSupport::Callbacks

      included do
        define_callbacks :slice

        def self.before_slice(*filters, &blk)
          set_callback(:slice, :before, *filters, &blk)
        end

        def self.after_slice(*filters, &blk)
          set_callback(:slice, :after, *filters, &blk)
        end

        def self.around_slice(*filters, &blk)
          set_callback(:slice, :around, *filters, &blk)
        end

        # before_batch and after_batch are called asynchronously.
        # around_batch is not supported.
        define_callbacks :before_batch
        define_callbacks :after_batch

        def self.before_batch(*filters, &blk)
          set_callback(:before_batch, :before, *filters, &blk)
        end

        def self.after_batch(*filters, &blk)
          set_callback(:after_batch, :after, *filters, &blk)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rocketjob-6.3.1 lib/rocket_job/batch/callbacks.rb
rocketjob-6.3.0 lib/rocket_job/batch/callbacks.rb
rocketjob-6.2.0 lib/rocket_job/batch/callbacks.rb
rocketjob-6.1.1 lib/rocket_job/batch/callbacks.rb
rocketjob-6.1.0 lib/rocket_job/batch/callbacks.rb
rocketjob-6.0.3 lib/rocket_job/batch/callbacks.rb
rocketjob-6.0.2 lib/rocket_job/batch/callbacks.rb
rocketjob-6.0.1 lib/rocket_job/batch/callbacks.rb
rocketjob-6.0.0 lib/rocket_job/batch/callbacks.rb
rocketjob-6.0.0.rc3 lib/rocket_job/batch/callbacks.rb
rocketjob-6.0.0.rc2 lib/rocket_job/batch/callbacks.rb
rocketjob-6.0.0.rc1 lib/rocket_job/batch/callbacks.rb
rocketjob-5.4.1 lib/rocket_job/batch/callbacks.rb
rocketjob-5.4.0 lib/rocket_job/batch/callbacks.rb
rocketjob-5.4.0.beta2 lib/rocket_job/batch/callbacks.rb
rocketjob-5.4.0.beta1 lib/rocket_job/batch/callbacks.rb
rocketjob-5.3.3 lib/rocket_job/batch/callbacks.rb
rocketjob-5.3.2 lib/rocket_job/batch/callbacks.rb
rocketjob-5.3.1 lib/rocket_job/batch/callbacks.rb
rocketjob-5.3.0 lib/rocket_job/batch/callbacks.rb