Sha256: f427cccf581fef2a7e437e3362d1d9522983afaced51f03564e8540ae2a476a3

Contents?: true

Size: 911 Bytes

Versions: 6

Compression:

Stored size: 911 Bytes

Contents

# require 'queue_bus/tasks'
# will give you these tasks

namespace :queuebus do

  desc "Subscribes this application to QueueBus events"
  task :subscribe => [ :preload ] do
    manager = ::QueueBus::TaskManager.new(true)
    count = manager.subscribe!
    raise "No subscriptions created" if count == 0
  end

  desc "Unsubscribes this application from QueueBus events"
  task :unsubscribe => [ :preload ] do
    manager = ::QueueBus::TaskManager.new(true)
    count = manager.unsubscribe!
    puts "No subscriptions unsubscribed" if count == 0
  end

  desc "List QueueBus queues that need worked"
  task :queues => [ :preload ] do
    manager = ::QueueBus::TaskManager.new(false)
    queues = manager.queue_names + ['bus_incoming']
    puts queues.join(", ")
  end

  # Preload app files if this is Rails
  # you can also do this to load the right things
  task :preload do
    require 'queue-bus'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
queue-bus-0.8.1 lib/queue_bus/tasks.rb
queue-bus-0.8.0 lib/queue_bus/tasks.rb
queue-bus-0.7.0 lib/queue_bus/tasks.rb
queue-bus-0.6.0 lib/queue_bus/tasks.rb
queue-bus-0.5.9 lib/queue_bus/tasks.rb
queue-bus-0.5.8 lib/queue_bus/tasks.rb