class ActionDispatch::ServerTiming::Subscriber

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

# sig/action_dispatch/middleware/server_timing.rbs

class ActionDispatch::ServerTiming::Subscriber
  def call: (ActiveSupport::Notifications::Event event) -> Array[ActiveSupport::Notifications::Event]
end

:nodoc:

def call(event)

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

type ActionDispatch__ServerTiming__Subscriber_call_return_value =  | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event | ActiveSupport::Notifications::Event

def call: (ActiveSupport::Notifications::Event event) -> ActionDispatch__ServerTiming__Subscriber_call_return_value

This signature was generated using 11 samples from 1 application.

def call(event)
  if events = ActiveSupport::IsolatedExecutionState[KEY]
    events << event
  end
end

def collect_events

def collect_events
  events = []
  ActiveSupport::IsolatedExecutionState[KEY] = events
  yield
  events
ensure
  ActiveSupport::IsolatedExecutionState.delete(KEY)
end

def ensure_subscribed

def ensure_subscribed
  @mutex.synchronize do
    # Subscribe to all events, except those beginning with "!"
    # Ideally we would be more selective of what is being measured
    @subscriber ||= ActiveSupport::Notifications.subscribe(/\A[^!]/, self)
  end
end

def initialize

def initialize
  @mutex = Mutex.new
end

def unsubscribe

def unsubscribe
  @mutex.synchronize do
    ActiveSupport::Notifications.unsubscribe @subscriber
    @subscriber = nil
  end
end