refactor: extract SeriesBuffer, add SeriesBufferInner#146
Open
KevinWMatthews wants to merge 6 commits intonominal-io:mainfrom
Open
refactor: extract SeriesBuffer, add SeriesBufferInner#146KevinWMatthews wants to merge 6 commits intonominal-io:mainfrom
KevinWMatthews wants to merge 6 commits intonominal-io:mainfrom
Conversation
Contributor
Author
|
Please give this a proper stress test before merging! The current unit tests are a useful sanity check but don't appear to put the system under serious load, and I haven't created a large data set to try to exercise this to production level. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is an opinionated solution to #139 and is an extension of/alternative to #144 and #145. It details one approach to how data hiding can be enforced more rigorously.
I'm not sure how you all at Nominal prefer to stack PRs, so rather than opening six more PRs I simply stacked commits in a single PR. While this is less noisy for the repo, it can be a bit challenging to review. If you prefer a different workflow, let me know and I can accommodate.
If you like some of these concepts but not all, they can be extracted from the chain and (with some manipulation) landed independently.
The concepts are:
points_len()into thePointsTypeExttrait for sharingSeriesBufferinto a new module,series_buffer.rstake()toSeriesBufferGuardSeriesBufferInnertypewith_lock()API toSeriesBufferandSeriesBufferInnerSeriesBufferInnerinto inner scope for additional data hidingI rather like the idea of the
with_lock()API, which clearly exposes the lifetime of the mutex guard. This idea was borrowed from: