Sha256: 78d13d38ee47bde2333c1e9ac2cbfa56dce95fef39079920d20b759c68046da5
Contents?: true
Size: 801 Bytes
Versions: 13
Compression:
Stored size: 801 Bytes
Contents
# Request manager handles the threadlocal variable that holds the current # request. If there isn't one, then create one module ScoutApm class RequestManager def self.lookup find || create end # Get the current Thread local, and detecting, and not returning a stale request def self.find req = Thread.current[:scout_request] if req && (req.stopping? || req.recorded?) nil else req end end # Create a new TrackedRequest object for this thread def self.create store = if ScoutApm::Agent.instance.apm_enabled? ScoutApm::Agent.instance.store else ScoutApm::FakeStore.new end Thread.current[:scout_request] = TrackedRequest.new(store) end end end
Version data entries
13 entries across 13 versions & 1 rubygems