Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make all registry methods thread safe
The registry is backed by a Hash, which is not guaranteed to be thread safe on all interpreters. For piece of mind, this change synchronizes all accesses to the metrics hash. Another option would have been to use a [thread-safe Hash][1] instead of a Hash but this would have meant adding Ruby Concurrent as a dependency, which I'm assuming we don't want. Ref: #184 (comment) [1]: https://github.com/ruby-concurrency/concurrent-ruby/blob/v1.1.7/lib/concurrent-ruby/concurrent/hash.rb Signed-off-by: Matthieu Prat <matthieuprat@gocardless.com>
- Loading branch information