Skip to content

Instantly share code, notes, and snippets.

@mikewadhera
mikewadhera / application_tasks.rb
Created January 7, 2009 03:36
an example leveraging jruby-rack jms for background queue + cron in rails
require 'queueable'
class ApplicationTasks
include Queueable
end
class LongRunningTasks
include Queueable
queue 'myqueue'
def download(url)
require 'open-uri'
open("#{RAILS_ROOT}/tmp/#{Time.now.to_i}", 'w+') { |f| f.write(open(url).read) }
end