Class: Semian::ThreadSafe::PIDController
- Inherits:
-
Simple::PIDController
- Object
- Simple::PIDController
- Semian::ThreadSafe::PIDController
- Defined in:
- lib/semian/pid_controller.rb
Overview
Thread-safe version of PIDController
Instance Attribute Summary
Attributes inherited from Simple::PIDController
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ PIDController
constructor
A new instance of PIDController.
- #record_request(outcome) ⇒ Object
- #reset ⇒ Object
- #should_reject? ⇒ Boolean
- #update ⇒ Object
Methods inherited from Simple::PIDController
Constructor Details
#initialize(**kwargs) ⇒ PIDController
Returns a new instance of PIDController.
191 192 193 194 |
# File 'lib/semian/pid_controller.rb', line 191 def initialize(**kwargs) super(**kwargs) @lock = Mutex.new end |
Instance Method Details
#record_request(outcome) ⇒ Object
196 197 198 |
# File 'lib/semian/pid_controller.rb', line 196 def record_request(outcome) @lock.synchronize { super } end |
#reset ⇒ Object
208 209 210 |
# File 'lib/semian/pid_controller.rb', line 208 def reset @lock.synchronize { super } end |
#should_reject? ⇒ Boolean
204 205 206 |
# File 'lib/semian/pid_controller.rb', line 204 def should_reject? @lock.synchronize { super } end |
#update ⇒ Object
200 201 202 |
# File 'lib/semian/pid_controller.rb', line 200 def update @lock.synchronize { super } end |