You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following initialization with the documented :threadsafe keyword set to true doesn't yield a YAML::Store backend where @thread_safe=true. If I were calling YAML::Store#new directly, I would invoke:
In Moneta, I can't seem to do the equivalent with either Moneta#new or Moneta::Adapters::YAML#new. With Moneta#new, I get the following, where the backend shows @thread_safe=false. Perhaps Moneta::Lock is handling the thread-safety on behalf of YAML::Store, but this is an assumption rather than something I was able to find documented. Consider the following:
However, unless Moneta::Lock is handling the thread-safety on behalf of YAML::Store (which doesn't seen to be explicit in the documentation for Moneta or the YAML adapter) it seems as if the standard constructor doesn't have a way to pass other positional arguments to the :YAML backend. This may simply be a documentation issue, or possibly a bug. Either way, it should probably be more obvious about what arguments a given adapter can accept, or how (or even if) YAML::Store and other adapters can receive positional arguments during initialization.
The text was updated successfully, but these errors were encountered:
That initialises a store that doesn't use mutex locking, but does initialise the YAML backend with thread-safety.
As you said in your OP, the threadsafe option passed to Moneta.new does indeed insert a Moneta::Lock into the store - this is a general option (not particular to YAML).
The longer-term option for supporting this better through Moneta.new is probably to make thread-safety a feature that adapters can advertise, and to only use the lock middleware if its not a feature of the adapter (similar to how we do things like expiry). I'll keep this ticket open while we consider that possibility.
Given the following initialization with the documented :threadsafe keyword set to true doesn't yield a YAML::Store backend where
@thread_safe=true
. If I were calling YAML::Store#new directly, I would invoke:In Moneta, I can't seem to do the equivalent with either Moneta#new or Moneta::Adapters::YAML#new. With Moneta#new, I get the following, where the backend shows
@thread_safe=false
. Perhaps Moneta::Lock is handling the thread-safety on behalf of YAML::Store, but this is an assumption rather than something I was able to find documented. Consider the following:This seems to be fixable on the fly with:
However, unless Moneta::Lock is handling the thread-safety on behalf of YAML::Store (which doesn't seen to be explicit in the documentation for Moneta or the YAML adapter) it seems as if the standard constructor doesn't have a way to pass other positional arguments to the :YAML backend. This may simply be a documentation issue, or possibly a bug. Either way, it should probably be more obvious about what arguments a given adapter can accept, or how (or even if) YAML::Store and other adapters can receive positional arguments during initialization.
The text was updated successfully, but these errors were encountered: