Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 committed Feb 9, 2024
1 parent 8b1aac2 commit f60c5d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

## Installation

> **Warning**
>
> This is a very young project. Expect bugs 🐛
```bash
pip install httpx-ws
```
Expand All @@ -40,6 +36,7 @@ pip install httpx-ws
* [X] Automatic ping/pong answers
* [X] HTTPX transport to test WebSockets defined in ASGI apps
* [X] Automatic keepalive ping
* [X] `asyncio` and [Trio](https://trio.readthedocs.io/) support through [AnyIO](https://anyio.readthedocs.io/)

## Contributors ✨

Expand Down
8 changes: 6 additions & 2 deletions httpx_ws/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ShouldClose(Exception):

class WebSocketSession:
"""
Sync helper representing an opened WebSocket session.
Sync context manager representing an opened WebSocket session.
Attributes:
subprotocol (typing.Optional[str]):
Expand Down Expand Up @@ -446,6 +446,8 @@ def close(self, code: int = 1000, reason: typing.Optional[str] = None):
Internally, it'll send the
[CloseConnection][wsproto.events.CloseConnection] event.
*This method is automatically called when exiting the context manager.*
Args:
code:
The integer close code to indicate why the connection has closed.
Expand Down Expand Up @@ -569,7 +571,7 @@ def _wait_until_closed(

class AsyncWebSocketSession:
"""
Async helper representing an opened WebSocket session.
Async context manager representing an opened WebSocket session.
Attributes:
subprotocol (typing.Optional[str]):
Expand Down Expand Up @@ -932,6 +934,8 @@ async def close(self, code: int = 1000, reason: typing.Optional[str] = None):
Internally, it'll send the
[CloseConnection][wsproto.events.CloseConnection] event.
*This method is automatically called when exiting the context manager.*
Args:
code:
The integer close code to indicate why the connection has closed.
Expand Down
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ theme:
logo: octicons/arrow-switch-16
favicon: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M5.22 14.78a.75.75 0 0 0 1.06-1.06L4.56 12h8.69a.75.75 0 0 0 0-1.5H4.56l1.72-1.72a.75.75 0 0 0-1.06-1.06l-3 3a.75.75 0 0 0 0 1.06l3 3zm5.56-6.5a.75.75 0 1 1-1.06-1.06l1.72-1.72H2.75a.75.75 0 0 1 0-1.5h8.69L9.72 2.28a.75.75 0 0 1 1.06-1.06l3 3a.75.75 0 0 1 0 1.06l-3 3z'%3E%3C/path%3E%3C/svg%3E"
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
Expand Down

0 comments on commit f60c5d1

Please sign in to comment.