-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Return close code from WebSocketClient.run/connect #58
Conversation
adam-fowler
commented
Apr 17, 2024
- Return close code from WebSocketHandler. This is ignored by the server but passed back to the user when using the client
- Also throw errors, caused by closing WebSocket channel, Server should report these but otherwise ignore them. Client throws them
@@ -186,14 +187,14 @@ extension WebSocketClient { | |||
/// - eventLoopGroup: EventLoopGroup to run WebSocket client on | |||
/// - logger: Logger | |||
/// - process: Closure handling webSocket | |||
public static func connect( | |||
@discardableResult public static func connect( |
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.
Let's document the return here e.g. when it's nil
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.
Ok good point
@@ -112,7 +113,7 @@ public struct WebSocketClient { | |||
#endif | |||
|
|||
/// Connect and run handler | |||
public func run() async throws { | |||
@discardableResult public func run() async throws -> WebSocketErrorCode? { |
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.
Document the return here
@Joannis this has had some minor changes
|