Class: RuboCop::Cop::ThreadSafety::NewThread
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::ThreadSafety::NewThread
- Defined in:
- lib/rubocop/cop/thread_safety/new_thread.rb
Overview
Avoid starting new threads.
Let a framework like Sidekiq handle the threads.
Constant Summary collapse
- MSG =
'Avoid starting new threads.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
20 21 22 23 24 |
# File 'lib/rubocop/cop/thread_safety/new_thread.rb', line 20 def on_send(node) return unless new_thread?(node) add_offense(node, message: MSG) end |