Skip to content

Commit

Permalink
Update documentation about ws.send(...) return value (#968)
Browse files Browse the repository at this point in the history
## 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)
  • Loading branch information
jiahan-wu committed Mar 29, 2024
1 parent 342ae63 commit b6a8f3a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/advanced/websockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b6a8f3a

Please sign in to comment.