BreadBoard icon indicating copy to clipboard operation
BreadBoard copied to clipboard

Singleton::WithParameters does not lock

Open dakkar opened this issue 10 years ago • 1 comments

BB::Lifecycle::Singleton uses a lock while geting, but BB::Lifecycle::Singleton::WithParameters does not. Why? Should it? Should the lock be on the whole service, or on the specific get call (i.e. should we have a single boolean lock, or a hashref from parameters keys to booleans)?

dakkar avatar Mar 30 '15 17:03 dakkar

You could add a lock here, how much value it provides I don't know. My experience with Singleton::WithParameters is that it is very rare to actually create singletons with the same parameters in practice, so locking, while correct, is likely not that important.

stevan avatar Mar 31 '15 14:03 stevan