-
Notifications
You must be signed in to change notification settings - Fork 24
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
Provide way to set cluster consistency #8
Conversation
rdar://102086631
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of nits but looks good otherwise. Thanks for the quick fix!
@@ -90,7 +90,7 @@ public class CassandraClient: CassandraSession { | |||
/// - logger: If `nil`, the client's default `Logger` is used. | |||
/// | |||
/// - Returns: The resulting ``Rows``. | |||
public func execute(statement: Statement, on eventLoop: EventLoop?, logger: Logger? = nil) -> EventLoopFuture<Rows> { | |||
public func execute(statement: Statement, on eventLoop: EventLoop?, logger: Logger? = .none) -> EventLoopFuture<Rows> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
completely subjective but IMO .none
is less idiomatic than nil
|
||
public extension CassandraClient { | ||
/// Consistency levels | ||
enum Consistency { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be public
.
I'm also wondering if this should be a struct
backed by an internal enum
with a public static let
per-case: users shouldn't need to switch over it and new "cases" can be added without breaking API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relatedly: CassandraClient.Configuration
should also be public
(all the methods and functions are but the type isn't)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my mistake: both are defined in public extension
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating SwiftFormat rule to prevent this sort of confusion. Amended a245c86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also wondering if this should be a struct backed by an internal enum with a public static let per-case
I understand your point, but I doubt users would switch over this particular enum.
rdar://102086631