class RuboCop::Cop::ThreadSafety::NewThread

Avoid starting new threads.

Let a framework like Sidekiq handle the threads.

@example

# bad
Thread.new { do_work }

Constants

MSG

Public Instance Methods

on_send(node) click to toggle source
# 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