-
Notifications
You must be signed in to change notification settings - Fork 4
Use Swift's new asynchronous primitives #2
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
Merged
Merged
Conversation
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
5 tasks
Instead of relying on NIO and Foundation library for various asynchronous computation, we use the new async/await key words, Swift actor features and new testing library to simplify the implementation as well as API.
3286c77 to
59d17fd
Compare
jzhou77
reviewed
Sep 4, 2025
jzhou77
approved these changes
Sep 11, 2025
1amageek
added a commit
to 1amageek/fdb-swift-bindings
that referenced
this pull request
Nov 8, 2025
Remove manual implementations of Equatable and Hashable in Versionstamp and Subspace. The compiler can synthesize these conformances automatically since all stored properties already conform to these protocols. This improves code maintainability and follows Swift best practices. Addresses: glbrntt review comment FoundationDB#2
1amageek
added a commit
to 1amageek/fdb-swift-bindings
that referenced
this pull request
Nov 8, 2025
1. Use TupleTypeCode enum in switch statements for type safety
Convert raw UInt8 type code to TupleTypeCode enum before switching.
This provides compile-time safety and makes the code more maintainable.
2. Rename encode/decode to pack/unpack for cross-language consistency
All official FoundationDB bindings use pack/unpack terminology:
- Python: tuple.pack() / tuple.unpack()
- Java: Tuple.pack() / Tuple.fromBytes()
- Go: Tuple.Pack() / Tuple.Unpack()
Using pack/unpack:
- Matches established FDB terminology ("tuple packing")
- Avoids confusion with Swift's Codable encode/decode
- Improves searchability and documentation consistency
API changes:
- Tuple.encode() → Tuple.pack()
- Tuple.decode(from:) → Tuple.unpack(from:)
- Subspace methods already used pack/unpack (no change)
Addresses: glbrntt review comment FoundationDB#9, MMcM review comment FoundationDB#2
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.
Instead of relying on NIO and Foundation library for various asynchronous computation, we use the new async/await key words, Swift actor features and new testing library to simplify the implementation as well as API.