Skip to content

Comments

Replace redis with valkey#1

Merged
adam-fowler merged 6 commits intomainfrom
valkey
Sep 12, 2025
Merged

Replace redis with valkey#1
adam-fowler merged 6 commits intomainfrom
valkey

Conversation

@adam-fowler
Copy link
Member

This means we ditch most of the code.
And we are left with just the persist driver

/// create new key with value. If key already exist throw `PersistError.duplicate` error
public func create(key: String, value: some Codable, expires: Duration?) async throws {
let expiration: SET<ByteBuffer>.Expiration? = expires.map { .milliseconds(Int($0 / .milliseconds(1))) }
let jsonBuffer = try ByteBuffer(bytes: JSONEncoder().encode(value))
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we try to serialize to RESP instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

The SET command only takes a buffer/string for a value, serialising to RESP isn't possible here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess the value string could be RESP. But I'm not sure I see any advantage to that.

@adam-fowler adam-fowler merged commit 6e76417 into main Sep 12, 2025
5 checks passed
@adam-fowler adam-fowler deleted the valkey branch September 12, 2025 15:27
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