module Sentry

def get_current_hub

Experimental RBS support (using type sampling data from the type_fusion project).

def get_current_hub: () -> Sentry::Hub

This signature was generated using 3 samples from 1 application.

Returns:
  • (Hub) -
def get_current_hub
  # we need to assign a hub to the current thread if it doesn't have one yet
  #
  # ideally, we should do this proactively whenever a new thread is created
  # but it's impossible for the SDK to keep track every new thread
  # so we need to use this rather passive way to make sure the app doesn't crash
  Thread.current.thread_variable_get(THREAD_LOCAL) || clone_hub_to_current_thread
end