Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make threadsafe #12

Open
chrisbloom7 opened this issue Mar 14, 2019 · 0 comments
Open

Make threadsafe #12

chrisbloom7 opened this issue Mar 14, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@chrisbloom7
Copy link
Owner

chrisbloom7 commented Mar 14, 2019

  1. The base Enumpath module sets up a number of module level variables (@verbose, @logger, and @path_cache) that make this library not threadsafe. This was initially done to avoid needing to instantiate an object, i.e. Enumpath.apply('food.0', party), and so that state didn't need to be passed around to all of the operators and processors. Our approach to this should be considered alongside Investigate re-implementing a version that caches segment types #3.
  2. Memoization using ||= (which may not be threadsafe) in Enumpath::Path#cache
  3. For things that may be shared across threads, like the logger or path cache, ensure no instance variables are used
  4. MiniCache is not threadsafe :( Maybe we need to expose a way to BYO cache store? (This is on my future feature list anyway) Or roll something similar with concurrent-ruby, et al?)
  5. to_regexp appears to be threadsafe, but we should verify
@chrisbloom7 chrisbloom7 added the enhancement New feature or request label Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant