Class: Aikido::Zen::Middleware::ForkDetector
- Inherits:
-
Object
- Object
- Aikido::Zen::Middleware::ForkDetector
- Defined in:
- lib/aikido/zen/middleware/fork_detector.rb
Overview
This middleware is responsible for detecting when a process has forked (e.g., in a Puma or Unicorn worker) and resetting the state of the Aikido Zen agent. It should be inserted early in the middleware stack.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ForkDetector
constructor
A new instance of ForkDetector.
Constructor Details
#initialize(app) ⇒ ForkDetector
Returns a new instance of ForkDetector.
10 11 12 13 14 |
# File 'lib/aikido/zen/middleware/fork_detector.rb', line 10 def initialize(app) @app = app @pid = Concurrent::AtomicFixnum.new(Process.pid) end |