-
-
Save tobias/1621669 to your computer and use it in GitHub Desktop.
integration_test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in the test: | |
queue = TorqueBox::Messaging::Queue.new( '/queue/response' ) | |
queue.receive( :timeout => 120_000 ).should == 'started' | |
queue.receive( :timeout => 5_000 ).should be_nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LongRunningJob | |
include TorqueBox::Injectors | |
def initialize(opts) | |
@options = opts | |
@response_queue = inject( '/queue/response' ) | |
end | |
def run() | |
$stderr.puts "Job executing! queue is #{@response_queue}" | |
@response_queue.publish( 'started' ) | |
sleep( 5 ) | |
@response_queue.publish( 'done' ) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
job.four: | |
job: LongRunningJob | |
description: My long running job has timeout | |
cron: "*/1 * * * * ?" | |
timeout: 3 s | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment