feat: Implement Dataset, KeyValueStore classes, create storage management logic - #21
Merged
Merged
Conversation
…t and request queue
jirimoravcik
marked this pull request as ready for review
January 11, 2023 22:04
fnesveda
requested changes
Jan 13, 2023
fnesveda
left a comment
Member
There was a problem hiding this comment.
Wow, looks great! I just had a couple of smaller comments, but otherwise I think it is good to go.
| self._cache = OrderedDict() | ||
| self._max_length = max_length | ||
|
|
||
| def get(self, key: str) -> Optional[T]: # TODO: Consider making this __getitem__ to be more Pythonic |
Member
There was a problem hiding this comment.
Wow, that would be really cool, if this had __getitem__, __setitem__ and __delitem__, then it would basically support the Mapping protocol and would be usable as a dictionary.
Member
Author
There was a problem hiding this comment.
Found a cool SO post about it https://stackoverflow.com/questions/19775685/how-to-correctly-implement-the-mapping-protocol-in-python
I'll look into it when implementing request queue, but it would be quite nice
also found this: https://gist.github.com/davesteele/44793cd0348f59f8fadd49d7799bd306
it directly inherits an OrderedDict
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.
Skipped
RequestQueueclass as it's quite big and not that related toActorclass. Will be in next PR