Module: Rodbot::Async
Defined Under Namespace
Classes: Job
Instance Method Summary collapse
-
#perform { ... } ⇒ Object
Perform code asynchronously.
Instance Method Details
#perform { ... } ⇒ Object
Perform code asynchronously
In order not to interfere with tests, the code is performed synchronously in case the current env is “test”!
26 27 28 29 30 31 32 |
# File 'lib/rodbot/async.rb', line 26 def perform(&block) if Rodbot.env.test? block.call else Job.perform_async(block) end end |