Skip to content

Instantly share code, notes, and snippets.

@198d
Created October 14, 2011 17:26
Show Gist options
  • Save 198d/1287741 to your computer and use it in GitHub Desktop.
Save 198d/1287741 to your computer and use it in GitHub Desktop.
RCelery Getting Started
task(:ignore_result => false)
def add(a,b)
a + b
end
task(:routing_key => 'some.other.applcation')
def cross_application
end
add().delay(1,2) # => #<RCelery::AsyncResult:0x10a406540 ... >
one().delay() # => nil
# Placeholder
include GettingStarted
add() # => #<RCelery::Task:0x1102f9390 ... >
add(1,2) # => 3
one(nil) # => 1
task(:name => 'tasks.number_one')
def one
1
end
development:
host: localhost
production:
host: prod.mq
require 'rubygems'
require 'rcelery'
RCelery.start(
:host => 'localhost',
:port => '5672',
:vhost => '/',
:username => 'guest',
:password => 'guest',
:application => 'application'
)
module GettingStarted
include RCelery::TaskSupport
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment