Class: Agent::BlockingOnce
Instance Method Summary collapse
Methods inherited from Once
Constructor Details
This class inherits a constructor from Agent::Once
Instance Method Details
#perform ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/agent/blocking_once.rb', line 5 def perform @mutex.synchronize do return nil, error if @performed begin value = yield @performed = true return value, nil rescue Errors::Rollback return nil, rollback_error end end end |