Sha256: 794540670362b33a9d9926140dab6cfc1065a9ced6cb5516008735af807c79c0

Contents?: true

Size: 597 Bytes

Versions: 2

Compression:

Stored size: 597 Bytes

Contents

module MultiWorker
  module Adapters
    class ThreadedInMemoryQueue
      def self.configure(base, opts={})
        base.class_eval do
          @queue = opts[:queue]

          def self.call(*args)
            perform(*args)
          end

          def self.perform(*args)
            self.new.perform(*args)
          end

          def self.perform_async(*args)
            ::ThreadedInMemoryQueue.enqueue(self, *args)
          end

          def perform_async(*args)
            self.class.perform_async(*args)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
multi_worker-0.2.0 lib/multi_worker/adapters/threaded_in_memory_queue.rb
multi_worker-0.1.0 lib/multi_worker/adapters/threaded_in_memory_queue.rb