Sha256: 23c879d8e96ba2ad74461e0afa51e5e8b488966b4e3281c0d0462b69d3b8c239

Contents?: true

Size: 337 Bytes

Versions: 13

Compression:

Stored size: 337 Bytes

Contents

module Sad
	module Worker
		def queue_name
			name = if self.respond_to?(:queue)
				self.send :queue
			else
				nil
			end
			Sad::Config.queue(name)
		end

		def enqueue(*args)
			payload = ::Sad::Payload.new(self.to_s, args)
			payload.sad_args['queue'] = queue_name
			yield payload if block_given?
			payload.enqueue
		end
	end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sad-1.5.11 lib/sad/worker.rb
sad-1.5.10 lib/sad/worker.rb
sad-1.5.9 lib/sad/worker.rb
sad-1.5.8 lib/sad/worker.rb
sad-1.5.7 lib/sad/worker.rb
sad-1.5.6 lib/sad/worker.rb
sad-1.5.5 lib/sad/worker.rb
sad-1.5.4 lib/sad/worker.rb
sad-1.5.3 lib/sad/worker.rb
sad-1.5.2 lib/sad/worker.rb
sad-1.5.1 lib/sad/worker.rb
sad-1.5.0 lib/sad/worker.rb
sad-1.4.0 lib/sad/worker.rb