Sha256: 7cfc126904b79e50e3f29714c4d7a08d0c54ff0eb07aef87e8822498584bc1e2

Contents?: true

Size: 695 Bytes

Versions: 1

Compression:

Stored size: 695 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

  # 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

1 entries across 1 versions & 1 rubygems

Version Path
queue-bus-0.5.4 lib/queue_bus/tasks.rb