Skip to content

Commit

Permalink
feat: add some more examples to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Dec 9, 2023
1 parent 2314cca commit ab861d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Install this via pip (or your favourite package manager):
addr_infos = await loop.getaddrinfo("example.org", 80)

socket = await start_connection(addr_infos)
socket = await start_connection(addr_infos, local_addr_infos=local_addr_infos, happy_eyeballs_delay=0.2)

transport, protocol = await loop.create_connection(
MyProtocol, sock=socket, ...)
Expand Down
10 changes: 8 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Start by importing it:

```python
import aiohappyeyeballs
```

TODO: Document usage
addr_infos = await loop.getaddrinfo("example.org", 80)

socket = await aiohappyeyeballs.start_connection(addr_infos)
socket = await aiohappyeyeballs.start_connection(addr_infos, local_addr_infos=local_addr_infos, happy_eyeballs_delay=0.2)

transport, protocol = await loop.create_connection(
MyProtocol, sock=socket, ...)
```

0 comments on commit ab861d6

Please sign in to comment.