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

feat: mem store #15

Merged
merged 8 commits into from
May 23, 2024
Merged

feat: mem store #15

merged 8 commits into from
May 23, 2024

Conversation

EthenNotEthan
Copy link
Collaborator

@EthenNotEthan EthenNotEthan commented May 22, 2024

Changes:

  • Add an ephemeral memory store DA backend which is usable via new feature flags
  • Added mem store tests for key set/get and expiration flows
  • Removed plasma reference in favor of proxy

Fixes: #14

@EthenNotEthan EthenNotEthan changed the base branch from epociask--feat-docker-and-rename to main May 22, 2024 20:02
@EthenNotEthan EthenNotEthan marked this pull request as ready for review May 23, 2024 06:44
@EthenNotEthan EthenNotEthan requested a review from teddyknox May 23, 2024 06:59

// Put inserts a value into the store.
func (e *MemStore) Put(ctx context.Context, value []byte) ([]byte, error) {
e.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a map in golang not threadsafe? Is there a need to lock here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some googling, apparently it is not threadsafe for writes, unless you use sync.Map. But this seems fine for now.

Copy link
Contributor

@teddyknox teddyknox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EthenNotEthan EthenNotEthan merged commit 834f866 into main May 23, 2024
3 checks passed
@EthenNotEthan EthenNotEthan deleted the epociask--feat-in-memory-store branch August 22, 2024 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants