Module: Lepus::AppExecutor

Included in:
Consumers::Middlewares::MaxRetry, Processes::Base
Defined in:
lib/lepus/app_executor.rb

Instance Method Summary collapse

Instance Method Details

#handle_thread_error(error) ⇒ Object



13
14
15
16
17
# File 'lib/lepus/app_executor.rb', line 13

def handle_thread_error(error)
  Lepus.instrument(:thread_error, error: error)

  Lepus.config.on_thread_error&.call(error)
end

#wrap_in_app_executor(&block) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/lepus/app_executor.rb', line 5

def wrap_in_app_executor(&block)
  if Lepus.config.app_executor
    Lepus.config.app_executor.wrap(&block)
  else
    yield
  end
end