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

Move to using ETS for Cachex states #39

Merged
merged 12 commits into from
Jun 17, 2016
Merged

Move to using ETS for Cachex states #39

merged 12 commits into from
Jun 17, 2016

Conversation

whitfin
Copy link
Owner

@whitfin whitfin commented Jun 14, 2016

This PR will resolve #38 once merged.

The changes will strip out the internal GenServer worker in favour of everything executing on the calling thread, meaning that the user has better control over concurrency. All states are stored in an ETS table at this point instead. The ETS table is handled by Eternal to make sure it doesn't die.

Both Hooks and Janitors still remain under a Supervisor, which now holds the cache name as the server name. The interface is identical apart from this.

The original intent was to remove the execute/3 action, but it still makes sense to keep (with tweaked documentation) as it avoids hitting the local ETS table N times for N actions.

Inspection needs further improvements because it's guaranteed a state, so it hits ETS needlessly. This will be addressed shortly.

  • Persistent ETS table
  • Remove internal GenServer
  • Remove the gen_delegate dependency
  • Provide internal wrappers to CRUD on state
  • Provide an application callback to setup ETS
  • Make sure that inspect uses the provided state
  • Strip out async and timeout options

@coveralls
Copy link

coveralls commented Jun 14, 2016

Coverage Status

Changes Unknown when pulling 8bc1012 on issue-38 into * on master*.

@coveralls
Copy link

coveralls commented Jun 14, 2016

Coverage Status

Changes Unknown when pulling 950e4ee on issue-38 into * on master*.

@coveralls
Copy link

coveralls commented Jun 15, 2016

Coverage Status

Changes Unknown when pulling 756ecf6 on issue-38 into * on master*.

@coveralls
Copy link

coveralls commented Jun 16, 2016

Coverage Status

Changes Unknown when pulling 57410be on issue-38 into * on master*.

@coveralls
Copy link

coveralls commented Jun 16, 2016

Coverage Status

Changes Unknown when pulling 345fe60 on issue-38 into * on master*.

@coveralls
Copy link

coveralls commented Jun 16, 2016

Coverage Status

Changes Unknown when pulling f3e5461 on issue-38 into * on master*.

@coveralls
Copy link

coveralls commented Jun 16, 2016

Coverage Status

Changes Unknown when pulling a02d1b2 on issue-38 into * on master*.

@whitfin
Copy link
Owner Author

whitfin commented Jun 17, 2016

Note to self: clean up do_action callbacks in the interface.

@coveralls
Copy link

coveralls commented Jun 17, 2016

Coverage Status

Changes Unknown when pulling d05889b on issue-38 into * on master*.

@whitfin whitfin merged commit 10e2983 into master Jun 17, 2016
@whitfin whitfin deleted the issue-38 branch June 17, 2016 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move to storing state in ETS tables and execute in the calling process
2 participants