README.md in active_beaneater-0.1.0 vs README.md in active_beaneater-0.1.1

- old
+ new

@@ -43,9 +43,32 @@ config.client = Beaneater.new("localhost:11300") # Default to BEANSTALK_URL ENV var config.prefix = 'yourapp' # Default to active-beaneater, can be an array, elements will be joined by a dot end ``` +### Creating jobs + +Jobs are normal ActiveJob jobs. There is an helper for ActiveBeaneater options: + +```ruby +class ImportJob < ActiveJob::Base + include ActiveBeaneater::QueueOptions + + queue_as :import # Name of the queue, will be prefixed before hitting beanstalk + queue_priority :low # Can be a number or :low or :high, smaller number = higher priority + queue_timeout_after 15.minutes # Timeout + + def perform(someid) + # Perform job here + + # You may do: + # native_job.try(:touch) + # To extend your timeout, like a keep alive, native_job may be nil when + # running specs with another active job backend + end +end +``` + ### Running jobs Simply issue `active_beaneater` from within your app root directory.