From b6a8f3a7555540a538fac9ef755843c847b96ca0 Mon Sep 17 00:00:00 2001 From: Jia-Han Wu Date: Fri, 29 Mar 2024 21:16:56 +0800 Subject: [PATCH] Update documentation about ws.send(...) return value (#968) ## Description The current documentation incorrectly states that ws.send(...) returns a value which can be awaited. However, the WebSocket.send method does not have a return value. ## Reference * [vapor/websocket-kit/Sources/WebSocketKit/Concurrency](https://github.com/vapor/websocket-kit/blob/main/Sources/WebSocketKit/Concurrency/WebSocket%2BConcurrency.swift) --- docs/advanced/websockets.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/advanced/websockets.md b/docs/advanced/websockets.md index ab17cca0d..253e6911f 100644 --- a/docs/advanced/websockets.md +++ b/docs/advanced/websockets.md @@ -58,11 +58,10 @@ promise.futureResult.whenComplete { result in } ``` -If using `async`/`await` you can `await` on the result +If using `async`/`await` you can use `await` to wait for the asynchronous operation to complete ```swift -// TODO Check this actually works -let result = try await ws.send(...) +try await ws.send(...) ``` ### Receiving